fix sending reject and confirmation mails

This commit is contained in:
Thomas Ruoff
2022-04-07 23:51:03 +02:00
parent ef11284c94
commit 0cdee14d18
2 changed files with 37 additions and 4 deletions

View File

@@ -84,13 +84,14 @@ export async function createBooking({
export async function patchBooking(
bookingUUID: string,
bookingData: Booking
): Promise<Booking> {
): Promise<{ current: Booking; previous: Booking }> {
await connect()
const booking = await getBookingByUUID(bookingUUID)
const oldBooking = booking.toJSON()
booking.set(bookingData)
await booking.save()
return booking.toJSON()
return { current: booking.toJSON(), previous: oldBooking }
}
export async function createBill(