Skip to main content

deleteRecurringEventInstances

talawa-api


talawa-api / helpers/event/deleteEventHelpers/deleteRecurringEventInstances / deleteRecurringEventInstances

Function: deleteRecurringEventInstances()

> deleteRecurringEventInstances(event, recurrenceRule, baseRecurringEvent, session): Promise<void>

Deletes all instances or thisAndFollowingInstances of a recurring event.

Parameters

event

null | InterfaceEvent

recurrenceRule

InterfaceRecurrenceRule

The recurrence rule associated with the instances.

baseRecurringEvent

InterfaceEvent

The base recurring event from which instances are derived.

session

ClientSession

Returns

Promise<void>

Remarks

This function performs the following steps:

  1. Constructs a query object to fetch instances based on the delete type.
  2. Retrieves and deletes all associated documents (attendees, users, profiles, action items).
  3. Deletes the instances themselves.
  4. Updates the recurrence rule and base recurring event as needed.
  5. Removes any dangling documents related to the recurrence rule and base recurring event.

Defined in

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