addEventAttendee
talawa-api • Docs
talawa-api / resolvers/Mutation/addEventAttendee / addEventAttendee
Variable: addEventAttendee
> const
addEventAttendee: MutationResolvers
["addEventAttendee"
]
Mutation resolver function to add a user as an attendee to an event.
This function performs the following actions:
- Retrieves the current user from the cache or database.
- Retrieves the current user's app profile from the cache or database.
- Retrieves the event from the cache or database.
- Checks if the user making the request is an admin of the event or a super admin.
- Validates that the user to be added as an attendee exists and is not already registered for the event.
- Checks if the user to be added is a member of the organization hosting the event.
- Adds the user as an attendee to the event if all checks pass.
Param
The parent object for the mutation. Typically, this is not used in this resolver.
Param
The arguments for the mutation, including:
data.eventId
: The ID of the event to which the user will be added as an attendee.data.userId
: The ID of the user to be added as an attendee.
Param
The context for the mutation, including:
userId
: The ID of the current user making the request.
See
- User - The User model used to interact with the users collection in the database.
- AppUserProfile - The AppUserProfile model used to interact with the app user profiles collection in the database.
- Event - The Event model used to interact with the events collection in the database.
- EventAttendee - The EventAttendee model used to manage event attendee registrations.
- MutationResolvers - The type definition for the mutation resolvers.