further code improvements

This commit is contained in:
Thomas Ruoff
2020-08-29 00:12:01 +02:00
committed by Thomas Ruoff
parent 52a68e9989
commit 4b16e07985
5 changed files with 23 additions and 22 deletions

View File

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