updateSingleEvent
talawa-api • Docs
talawa-api / helpers/event/updateEventHelpers/updateSingleEvent / updateSingleEvent
Function: updateSingleEvent()
> updateSingleEvent(args
, event
, session
): Promise
<InterfaceEvent
>
This function updates a single non-recurring event.
Parameters
• args: MutationUpdateEventArgs
the arguments provided for the updateEvent mutation.
• event: InterfaceEvent
the single event to be updated.
• session: ClientSession
Returns
Promise
<InterfaceEvent
>
The updated event.
Remarks
The following steps are followed:
- If the single event is made recurring with this update:
- get the appropriate data to create the baseRecurringEvent and recurring event instances.
- generate the instances with createRecurringEvent function.
- remove the current event and its associations as a new series has been created.
- If it's still a non-recurring event:
- just perform a regular update.
Defined in
src/helpers/event/updateEventHelpers/updateSingleEvent.ts:28