mirror of
https://github.com/tomru/pfadi-bussle.git
synced 2026-03-03 06:27:11 +01:00
use BOOKING_STATE in database calls
This commit is contained in:
@@ -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() } },
|
||||
|
||||
Reference in New Issue
Block a user