mirror of
https://github.com/tomru/pfadi-bussle.git
synced 2026-03-03 06:27:11 +01:00
get db and calendar bookings in parallel
This commit is contained in:
@@ -14,9 +14,10 @@ mongoose.connect(process.env.MONGO_URI, {
|
||||
export async function getBookedDays(
|
||||
uuidsToIngore?: string[]
|
||||
): Promise<string[]> {
|
||||
const bookedInDatabase = await BookingModel.findBookedDays(uuidsToIngore)
|
||||
const bookedInCalendar = await calendarGetBookedDays()
|
||||
|
||||
const [bookedInDatabase, bookedInCalendar] = await Promise.all([
|
||||
BookingModel.findBookedDays(uuidsToIngore),
|
||||
calendarGetBookedDays(),
|
||||
])
|
||||
return [...bookedInDatabase, ...bookedInCalendar].filter(uniqueFilter).sort()
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user