fix reacreate of bookingReferences when rescheduling (#2272)

Co-authored-by: Omar López <zomars@me.com>
pull/2278/head
alannnc 2022-03-24 16:29:32 -07:00 committed by GitHub
parent 296697370d
commit 92534c7e6d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 2 deletions

View File

@ -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,

View File

@ -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,