fix reacreate of bookingReferences when rescheduling (#2272)

Co-authored-by: Omar López <zomars@me.com>
This commit is contained in:
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); await Promise.all(promises);
// Avoid passing referencesToCreate with id unique constrain values
await prisma.booking.update({ await prisma.booking.update({
where: { where: {
uid: booking.uid, uid: booking.uid,

View file

@ -176,8 +176,9 @@ export default class EventManager {
select: { select: {
id: true, id: true,
references: { 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: { select: {
id: true,
type: true, type: true,
uid: true, uid: true,
meetingId: true, meetingId: true,