fix: metadata not saved while creating a booking. (#6866)

* feat: add metadata to booking creation

* fix: bug
feature/alert-no-availability-selected
Nafees Nazik 2023-02-06 23:35:30 +05:30 committed by GitHub
parent cc56602474
commit 390967990a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 1 deletions

View File

@ -744,6 +744,7 @@ async function handler(req: NextApiRequest & { userId?: number | undefined }) {
location: evt.location, location: evt.location,
eventType: eventTypeRel, eventType: eventTypeRel,
smsReminderNumber: reqBody.smsReminderNumber, smsReminderNumber: reqBody.smsReminderNumber,
metadata: reqBody.metadata,
attendees: { attendees: {
createMany: { createMany: {
data: evt.attendees.map((attendee) => { data: evt.attendees.map((attendee) => {
@ -1140,7 +1141,7 @@ async function handler(req: NextApiRequest & { userId?: number | undefined }) {
uid: booking.uid, uid: booking.uid,
}, },
data: { data: {
metadata, metadata: { ...(typeof booking.metadata === "object" && booking.metadata), ...metadata },
references: { references: {
createMany: { createMany: {
data: referencesToCreate, data: referencesToCreate,