talawa-api / Exports / helpers/event/updateEventHelpers/updateThisAndFollowingInstances
Module: helpers/event/updateEventHelpers/updateThisAndFollowingInstances
Table of contents
Functions
Functions
updateThisAndFollowingInstances
▸ updateThisAndFollowingInstances(args
, event
, recurrenceRule
, baseRecurringEvent
, session
): Promise
<InterfaceEvent
>
This function updates this and the following instances of a recurring event.
Parameters
Name | Type | Description |
---|---|---|
args | MutationUpdateEventArgs | update event args. |
event | InterfaceEvent | the event to be updated. |
recurrenceRule | InterfaceRecurrenceRule | the recurrence rule followed by the instances. |
baseRecurringEvent | InterfaceEvent | the base recurring event. |
session | ClientSession | - |
Returns
Promise
<InterfaceEvent
>
The updated first instance of the recurrence rule.
Remarks
The following steps are followed:
- Check if the recurrence rule has been changed.
- If the recurrence rule has been changed.
- 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 the recurrence rule hasn't changed:
- just perform a bulk regular update.
- Update the base recurring event if required.
Defined in
src/helpers/event/updateEventHelpers/updateThisAndFollowingInstances.ts:33