talawa-api / Exports / helpers/event/deleteEventHelpers/deleteRecurringEventInstances
Module: helpers/event/deleteEventHelpers/deleteRecurringEventInstances
Table of contents
Functions
Functions
deleteRecurringEventInstances
▸ deleteRecurringEventInstances(event
, recurrenceRule
, baseRecurringEvent
, session
): Promise
<void
>
This function deletes allInstances / thisAndFollowingInstances of a recurring event.
Parameters
Name | Type | Description |
---|---|---|
event | null | InterfaceEvent | the event to be deleted: - in case of deleting thisAndFollowingInstances, it would represent this instance. - in case of deleting allInstances, it would be null. |
recurrenceRule | InterfaceRecurrenceRule | the recurrence rule followed by the instances. |
baseRecurringEvent | InterfaceEvent | the base recurring event. |
session | ClientSession | - |
Returns
Promise
<void
>
Remarks
The following steps are followed:
- get the instances to be deleted.
- remove the associations of the instances.
- delete the instances.
- update the recurrenceRule and baseRecurringEvent accordingly.
- remove any dangling recurrence rule and base recurring event documents.
Defined in
src/helpers/event/deleteEventHelpers/deleteRecurringEventInstances.ts:30