mirror of
https://github.com/tomru/pfadi-bussle.git
synced 2026-03-04 15:07:13 +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 Booker from './booker'
|
||||||
import Booking from './booking'
|
import Booking from './booking'
|
||||||
|
import { BOOKING_STATUS } from './bookingStatus'
|
||||||
|
|
||||||
let connectedPromise
|
let connectedPromise
|
||||||
|
|
||||||
@@ -23,7 +24,7 @@ export async function getBookedDays() {
|
|||||||
|
|
||||||
const bookings = await Booking.find(
|
const bookings = await Booking.find(
|
||||||
{
|
{
|
||||||
status: { $ne: 'rejected' },
|
status: { $in: [BOOKING_STATUS.REQUESTED, BOOKING_STATUS.CONFIRMED] },
|
||||||
$or: [
|
$or: [
|
||||||
{ endDate: { $gt: new Date() } },
|
{ endDate: { $gt: new Date() } },
|
||||||
{ startDate: { $gt: new Date() } },
|
{ startDate: { $gt: new Date() } },
|
||||||
|
|||||||
Reference in New Issue
Block a user