mirror of
https://github.com/tomru/pfadi-bussle.git
synced 2026-03-03 06:27:11 +01:00
further code improvements
This commit is contained in:
committed by
Thomas Ruoff
parent
52a68e9989
commit
4b16e07985
@@ -11,7 +11,7 @@ export interface Booking
|
||||
booker: Booker
|
||||
startDate: Date
|
||||
endDate: Date
|
||||
status: string
|
||||
status: BOOKING_STATUS
|
||||
purpose: string
|
||||
org: string
|
||||
destination: string
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
export const BOOKING_STATUS = {
|
||||
REQUESTED: 'requested',
|
||||
CONFIRMED: 'confirmed',
|
||||
REJECTED: 'rejected',
|
||||
CANCELED: 'canceled',
|
||||
export enum BOOKING_STATUS {
|
||||
REQUESTED = 'requested',
|
||||
CONFIRMED = 'confirmed',
|
||||
REJECTED = 'rejected',
|
||||
CANCELED = 'canceled',
|
||||
}
|
||||
|
||||
@@ -41,12 +41,7 @@ export async function getBookedDays() {
|
||||
export async function getBookingByUUID(uuid: string) {
|
||||
await connect()
|
||||
const booking = await Booking.findOne({ uuid })
|
||||
return booking.populate('booker').execPopulate()
|
||||
}
|
||||
|
||||
export async function getBookingByUUIDAsJSON(uuid: string) {
|
||||
const booking = await getBookingByUUID(uuid)
|
||||
return booking.toJSON()
|
||||
return booking?.populate('booker').execPopulate()
|
||||
}
|
||||
|
||||
export async function createBooking({
|
||||
|
||||
Reference in New Issue
Block a user