From 18722261eb222dcb8e194871b7cf6b8ded258f16 Mon Sep 17 00:00:00 2001 From: Thomas Ruoff Date: Tue, 25 Aug 2020 23:55:42 +0200 Subject: [PATCH] use BOOKING_STATE in database calls --- db/index.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/db/index.js b/db/index.js index 3e2c10e..48a807a 100644 --- a/db/index.js +++ b/db/index.js @@ -2,6 +2,7 @@ import * as mongoose from 'mongoose' import Booker from './booker' import Booking from './booking' +import { BOOKING_STATUS } from './bookingStatus' let connectedPromise @@ -23,7 +24,7 @@ export async function getBookedDays() { const bookings = await Booking.find( { - status: { $ne: 'rejected' }, + status: { $in: [BOOKING_STATUS.REQUESTED, BOOKING_STATUS.CONFIRMED] }, $or: [ { endDate: { $gt: new Date() } }, { startDate: { $gt: new Date() } },