Skip to main content

talawa-api / Exports / helpers/event/recurringEventHelpers/removeDanglingDocuments

Module: helpers/event/recurringEventHelpers/removeDanglingDocuments

Table of contents

Functions

Functions

removeDanglingDocuments

removeDanglingDocuments(recurrenceRuleId, baseRecurringEventId, session): Promise<void>

This function removes dangling recurrence rule and base recurring event documents.

Parameters

NameTypeDescription
recurrenceRuleIdstring_id of the recurrence rule.
baseRecurringEventIdstring_id of the base recurring event.
sessionClientSession-

Returns

Promise<void>

Remarks

The following steps are followed:

  1. Call the function associated with the document to be removed, i.e. removeRecurrenceRule or removeBaseRecurringEvent.
  2. Check if the document has any associations, i.e.:
  • for recurrence rule, check if there exist any event that follow this given recurrence rule
  • for base recurring event, check if there exist any event that has this event as its base recurring event
  1. Remove the documents if no associations are found.

Defined in

src/helpers/event/recurringEventHelpers/removeDanglingDocuments.ts:16