Retain rescheduleUid when picking a date

This commit is contained in:
nicolas 2021-07-18 22:17:18 +02:00
parent 81e1287693
commit a40a5c04fe
2 changed files with 13 additions and 6 deletions

View file

@ -45,9 +45,8 @@ export default class EventManager {
} }
public async update(event: CalendarEvent, booking: PartialBooking): Promise<Array<EventResult>> { public async update(event: CalendarEvent, booking: PartialBooking): Promise<Array<EventResult>> {
const results: Array<EventResult> = [];
// First, update all calendar events. // First, update all calendar events.
results.concat(await this.updateAllCalendarEvents(event, booking)); const results: Array<EventResult> = await this.updateAllCalendarEvents(event, booking);
// If and only if event type is a video meeting, update the video meeting as well. // If and only if event type is a video meeting, update the video meeting as well.
if (EventManager.isIntegration(event.location)) { if (EventManager.isIntegration(event.location)) {
@ -95,7 +94,7 @@ export default class EventManager {
booking: PartialBooking booking: PartialBooking
): Promise<Array<EventResult>> { ): Promise<Array<EventResult>> {
return async.mapLimit(this.calendarCredentials, 5, async (credential) => { return async.mapLimit(this.calendarCredentials, 5, async (credential) => {
const bookingRefUid = booking.references.filter((ref) => ref.type === credential.type)[0].uid; const bookingRefUid = booking.references.filter((ref) => ref.type === credential.type)[0]?.uid;
return updateEvent(credential, bookingRefUid, event); return updateEvent(credential, bookingRefUid, event);
}); });
} }

View file

@ -48,9 +48,17 @@ export default function Type(props): Type {
router.replace( router.replace(
{ {
query: { query: Object.assign(
date: formattedDate, {},
}, {
date: formattedDate,
},
rescheduleUid
? {
rescheduleUid: rescheduleUid,
}
: {}
),
}, },
undefined, undefined,
{ {