add patch for bookings and only allow status

This commit is contained in:
Thomas Ruoff
2020-08-25 23:56:41 +02:00
parent 18722261eb
commit ec294eaabe
2 changed files with 41 additions and 4 deletions

View File

@@ -42,8 +42,12 @@ export async function getBookedDays() {
export async function getBookingByUUID(uuid) {
await connect()
const booking = await Booking.findOne({ uuid })
await booking.populate('booker').execPopulate()
return booking
return booking.populate('booker').execPopulate()
}
export async function getBookingByUUIDAsJSON(uuid) {
const booking = await getBookingByUUID(uuid)
return booking.toJSON()
}
export async function createBooking({