Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
…awa-admin into develop
  • Loading branch information
ALOK9442 committed Jan 16, 2024
2 parents 13dd7eb + 84c6697 commit c9d5696
Show file tree
Hide file tree
Showing 17 changed files with 1,078 additions and 669 deletions.
14 changes: 10 additions & 4 deletions .github/workflows/pull-requests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:
- name: Count number of lines
run: |
chmod +x ./.github/workflows/countline.py
./.github/workflows/countline.py --lines 1000 --exclude_files src/screens/LoginPage/LoginPage.tsx
./.github/workflows/countline.py --lines 600 --exclude_files src/screens/LoginPage/LoginPage.tsx
- name: Get changed TypeScript files
id: changed-files
Expand Down Expand Up @@ -127,9 +127,15 @@ jobs:

- name: resolve dependency
run: npm install -g @graphql-inspector/cli

- name: Clone API repository
run: git clone https://github.com/PalisadoesFoundation/talawa-api && ls -a

- name: Clone API Repository
run: |
# Retrieve the complete branch name directly from the GitHub context
FULL_BRANCH_NAME=${{ github.base_ref }}
echo "FULL_Branch_NAME: $FULL_BRANCH_NAME"
# Clone the specified repository using the extracted branch name
git clone --branch $FULL_BRANCH_NAME https://github.com/PalisadoesFoundation/talawa-api && ls -a
- name: Validate Documents
run: graphql-inspector validate './src/GraphQl/**/*.ts' './talawa-api/schema.graphql'
5 changes: 5 additions & 0 deletions .idea/.gitignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/inspectionProfiles/Project_Default.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions .idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 12 additions & 0 deletions .idea/talawa-admin.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

58 changes: 58 additions & 0 deletions src/GraphQl/Mutations/CommentMutations.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
import gql from 'graphql-tag';

/**
* GraphQL mutation to create a new comment on a post.
*
* @param comment - The text content of the comment.
* @param postId - The ID of the post to which the comment is being added.
* @returns The created comment object.
*/

export const CREATE_COMMENT_POST = gql`
mutation createComment($comment: String!, $postId: ID!) {
createComment(data: { text: $comment }, postId: $postId) {
_id
creator {
_id
firstName
lastName
email
}
likeCount
likedBy {
_id
}
text
}
}
`;

/**
* GraphQL mutation to like a comment.
*
* @param commentId - The ID of the comment to be liked.
* @returns The liked comment object.
*/

export const LIKE_COMMENT = gql`
mutation likeComment($commentId: ID!) {
likeComment(id: $commentId) {
_id
}
}
`;

/**
* GraphQL mutation to unlike a comment.
*
* @param commentId - The ID of the comment to be unliked.
* @returns The unliked comment object.
*/

export const UNLIKE_COMMENT = gql`
mutation unlikeComment($commentId: ID!) {
unlikeComment(id: $commentId) {
_id
}
}
`;
63 changes: 63 additions & 0 deletions src/GraphQl/Mutations/EventAttendeeMutations.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
import gql from 'graphql-tag';

/**
* GraphQL mutation to add an attendee to an event.
*
* @param userId - The ID of the user being added as an attendee.
* @param eventId - The ID of the event to which the user is being added as an attendee.
* @returns The updated event object with the added attendee.
*/

export const ADD_EVENT_ATTENDEE = gql`
mutation addEventAttendee($userId: ID!, $eventId: ID!) {
addEventAttendee(data: { userId: $userId, eventId: $eventId }) {
_id
}
}
`;

/**
* GraphQL mutation to remove an attendee from an event.
*
* @param userId - The ID of the user being removed as an attendee.
* @param eventId - The ID of the event from which the user is being removed as an attendee.
* @returns The updated event object without the removed attendee.
*/

export const REMOVE_EVENT_ATTENDEE = gql`
mutation removeEventAttendee($userId: ID!, $eventId: ID!) {
removeEventAttendee(data: { userId: $userId, eventId: $eventId }) {
_id
}
}
`;

/**
* GraphQL mutation to mark a user's check-in at an event.
*
* @param userId - The ID of the user checking in.
* @param eventId - The ID of the event at which the user is checking in.
* @param allotedRoom - The room assigned to the user during check-in (optional).
* @param allotedSeat - The seat assigned to the user during check-in (optional).
* @returns The updated event object with the user's check-in information.
*/

export const MARK_CHECKIN = gql`
mutation checkIn(
$userId: ID!
$eventId: ID!
$allotedRoom: String
$allotedSeat: String
) {
checkIn(
data: {
userId: $userId
eventId: $eventId
allotedRoom: $allotedRoom
allotedSeat: $allotedSeat
}
) {
_id
}
}
`;
65 changes: 65 additions & 0 deletions src/GraphQl/Mutations/EventTaskMutations.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
import gql from 'graphql-tag';

/**
* GraphQL mutation to update an event project task.
*
* @param title - The updated title of the task.
* @param description - The updated description of the task.
* @param taskId - The ID of the task to be updated.
* @param deadline - The updated deadline for the task.
* @param completed - The updated completion status of the task.
* @returns The updated task object.
*/

export const UPDATE_EVENT_PROJECT_TASK_MUTATION = gql`
mutation UpdateEventTask(
$title: String!
$description: String!
$taskId: ID!
$deadline: DateTime!
$completed: Boolean!
) {
updateTask(
id: $taskId
data: {
title: $title
description: $description
deadline: $deadline
completed: $completed
}
) {
_id
}
}
`;

/**
* GraphQL mutation to delete an event project task.
*
* @param id - The ID of the task to be deleted.
* @returns The deleted task object.
*/

export const DELETE_EVENT_TASK_MUTATION = gql`
mutation DeleteTask($id: ID!) {
removeTask(id: $id) {
_id
}
}
`;

/**
* GraphQL mutation to set volunteers for an event project task.
*
* @param id - The ID of the task for which volunteers are being set.
* @param volunteers - An array of user IDs representing the volunteers for the task.
* @returns The updated task object with the assigned volunteers.
*/

export const SET_TASK_VOLUNTEERS_MUTATION = gql`
mutation SetTaskVolunteers($id: ID!, $volunteers: [ID]!) {
setTaskVolunteers(id: $id, volunteers: $volunteers) {
_id
}
}
`;
Loading

0 comments on commit c9d5696

Please sign in to comment.