Skip to main content

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

NameTypeDescription
eventnull | InterfaceEventthe event to be deleted: - in case of deleting thisAndFollowingInstances, it would represent this instance. - in case of deleting allInstances, it would be null.
recurrenceRuleInterfaceRecurrenceRulethe recurrence rule followed by the instances.
baseRecurringEventInterfaceEventthe base recurring event.
sessionClientSession-

Returns

Promise<void>

Remarks

The following steps are followed:

  1. get the instances to be deleted.
  2. remove the associations of the instances.
  3. delete the instances.
  4. update the recurrenceRule and baseRecurringEvent accordingly.
  5. remove any dangling recurrence rule and base recurring event documents.

Defined in

src/helpers/event/deleteEventHelpers/deleteRecurringEventInstances.ts:30