From 92534c7e6dbbe5d96eee3cdf1761ee112f68438a Mon Sep 17 00:00:00 2001 From: alannnc Date: Thu, 24 Mar 2022 16:29:32 -0700 Subject: [PATCH] fix reacreate of bookingReferences when rescheduling (#2272) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Omar López --- apps/web/pages/api/book/event.ts | 2 +- packages/core/EventManager.ts | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/apps/web/pages/api/book/event.ts b/apps/web/pages/api/book/event.ts index b9b933d348..5eb9d16729 100644 --- a/apps/web/pages/api/book/event.ts +++ b/apps/web/pages/api/book/event.ts @@ -636,7 +636,7 @@ export default async function handler(req: NextApiRequest, res: NextApiResponse) }) ); await Promise.all(promises); - + // Avoid passing referencesToCreate with id unique constrain values await prisma.booking.update({ where: { uid: booking.uid, diff --git a/packages/core/EventManager.ts b/packages/core/EventManager.ts index 7c5b003ff6..f8b98454c0 100644 --- a/packages/core/EventManager.ts +++ b/packages/core/EventManager.ts @@ -176,8 +176,9 @@ export default class EventManager { select: { id: true, references: { + // NOTE: id field removed from select as we don't require for deletingMany + // but was giving error on recreate for reschedule, probably because promise.all() didn't finished select: { - id: true, type: true, uid: true, meetingId: true,