popuplate booker when getting bookings

This commit is contained in:
Thomas Ruoff
2020-09-16 23:36:28 +02:00
committed by Thomas Ruoff
parent cd5fa56807
commit c136b2d2e1

View File

@@ -32,11 +32,11 @@ export async function getBookingByUUID(uuid: string) {
export async function getBookings() {
await connect()
const bookings = await Booking.find({
return await Booking.find({
status: { $in: [BOOKING_STATUS.REQUESTED, BOOKING_STATUS.CONFIRMED] },
})
// populate?
return bookings
.populate('booker')
.exec()
}
export async function createBooking({