mirror of
https://github.com/tomru/pfadi-bussle.git
synced 2026-03-03 06:27:11 +01:00
firt attempt for an ics calendar
This commit is contained in:
committed by
Thomas Ruoff
parent
2b0cbe565f
commit
56c8263e90
10
db/index.ts
10
db/index.ts
@@ -2,6 +2,7 @@ import * as mongoose from 'mongoose'
|
||||
import Booker from './booker'
|
||||
import Booking from './booking'
|
||||
import { dateFormatFrontend } from '../helpers/date'
|
||||
import { BOOKING_STATUS } from './bookingStatus'
|
||||
|
||||
let connectedPromise: Promise<typeof mongoose>
|
||||
|
||||
@@ -29,6 +30,15 @@ export async function getBookingByUUID(uuid: string) {
|
||||
return booking?.populate('booker').execPopulate()
|
||||
}
|
||||
|
||||
export async function getBookings() {
|
||||
await connect()
|
||||
const bookings = await Booking.find({
|
||||
status: { $in: [BOOKING_STATUS.REQUESTED, BOOKING_STATUS.CONFIRMED] },
|
||||
})
|
||||
// populate?
|
||||
return bookings
|
||||
}
|
||||
|
||||
export async function createBooking({
|
||||
startDate,
|
||||
endDate,
|
||||
|
||||
Reference in New Issue
Block a user