From c136b2d2e11b93ecb97deb15cab36eff0852821d Mon Sep 17 00:00:00 2001 From: Thomas Ruoff Date: Wed, 16 Sep 2020 23:36:28 +0200 Subject: [PATCH] popuplate booker when getting bookings --- db/index.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/db/index.ts b/db/index.ts index 70d16eb..f346217 100644 --- a/db/index.ts +++ b/db/index.ts @@ -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({