Skip to main content

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

Module: helpers/event/updateEventHelpers/updateSingleEvent

Table of contents

Functions

Functions

updateSingleEvent

updateSingleEvent(args, event, session): Promise<InterfaceEvent>

This function updates a single non-recurring event.

Parameters

NameTypeDescription
argsMutationUpdateEventArgsthe arguments provided for the updateEvent mutation.
eventInterfaceEventthe single event to be updated.
sessionClientSession-

Returns

Promise<InterfaceEvent>

The updated event.

Remarks

The following steps are followed:

  1. If the single event is made recurring with this update:
  • 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 it's still a non-recurring event:
  • just perform a regular update.

Defined in

src/helpers/event/updateEventHelpers/updateSingleEvent.ts:28