fix: metadata get lost when rescheduling (#7873)

pull/7779/head^2
Nafees Nazik 2023-03-22 15:47:19 +05:30 committed by GitHub
parent 79f7a16f62
commit e4eb21bf8d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 0 deletions

View File

@ -1485,6 +1485,9 @@ async function handler(
newBookingData.recurringEventId = reqBody.recurringEventId; newBookingData.recurringEventId = reqBody.recurringEventId;
} }
if (originalRescheduledBooking) { if (originalRescheduledBooking) {
newBookingData.metadata = {
...(typeof originalRescheduledBooking.metadata === "object" && originalRescheduledBooking.metadata),
};
newBookingData["paid"] = originalRescheduledBooking.paid; newBookingData["paid"] = originalRescheduledBooking.paid;
newBookingData["fromReschedule"] = originalRescheduledBooking.uid; newBookingData["fromReschedule"] = originalRescheduledBooking.uid;
if (newBookingData.attendees?.createMany?.data) { if (newBookingData.attendees?.createMany?.data) {