Skip to main content

talawa-api / Exports / helpers/event/updateEventHelpers/updateThisAndFollowingInstances

Module: helpers/event/updateEventHelpers/updateThisAndFollowingInstances

Table of contents

Functions

Functions

updateThisAndFollowingInstances

updateThisAndFollowingInstances(args, event, recurrenceRule, baseRecurringEvent, session): Promise<InterfaceEvent>

This function updates this and the following instances of a recurring event.

Parameters

NameTypeDescription
argsMutationUpdateEventArgsupdate event args.
eventInterfaceEventthe event to be updated.
recurrenceRuleInterfaceRecurrenceRulethe recurrence rule followed by the instances.
baseRecurringEventInterfaceEventthe base recurring event.
sessionClientSession-

Returns

Promise<InterfaceEvent>

The updated first instance of the recurrence rule.

Remarks

The following steps are followed:

  1. Check if the recurrence rule has been changed.
  2. If the recurrence rule has been changed.
  • get the appropriate data to create the baseRecurringEvent and recurring event instances.
  • generate the instances with createRecurringEvent function.
  • remove the current event and its associations as a new series has been created.
  1. If the recurrence rule hasn't changed:
  • just perform a bulk regular update.
  1. Update the base recurring event if required.

Defined in

src/helpers/event/updateEventHelpers/updateThisAndFollowingInstances.ts:33