talawa-api / Exports / helpers/event/updateEventHelpers/updateRecurringEventInstances
Module: helpers/event/updateEventHelpers/updateRecurringEventInstances
Table of contents
Functions
Functions
updateRecurringEventInstances
▸ updateRecurringEventInstances(args
, event
, recurrenceRule
, baseRecurringEvent
, recurringEventUpdateType
, 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. |
recurringEventUpdateType | RecurringEventMutationType | - |
session | ClientSession | - |
Returns
Promise
<InterfaceEvent
>
The updated first instance following the recurrence rule.
Remarks
The following steps are followed:
- Check if the recurrence rule has changed.
- If the recurrence rule has changed:
- get the appropriate data to create new recurring event instances and update the baseRecurringEvent.
- get the recurrence dates and generate new instances.
- remove the current instances and their associations as a new series has been created. If the recurrence rule hasn't changed:
- just perform a regular bulk update.
- Update the base recurring event if required.
- Removes any dangling recurrence rule and base recurrence rule documents.
Defined in
src/helpers/event/updateEventHelpers/updateRecurringEventInstances.ts:45