extract patch booking to db

This commit is contained in:
Thomas Ruoff
2022-03-14 23:52:32 +01:00
committed by Thomas Ruoff
parent ef7f80fd92
commit d9cd2af314
2 changed files with 15 additions and 5 deletions

View File

@@ -76,6 +76,18 @@ export async function createBooking({
return booking.toJSON()
}
export async function patchBooking(
bookingUUID: string,
bookingData: Booking,
): Promise<Booking> {
await connect()
const booking = await getBookingByUUID(bookingUUID)
booking.set(bookingData);
await booking.save()
return booking.toJSON()
}
export async function createBill(
bookingUUID: string,
billData: Bill