mirror of
https://github.com/tomru/pfadi-bussle.git
synced 2026-03-03 06:27:11 +01:00
update mongoose to 5.8.3 (lots of types changes)
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import { google } from 'googleapis'
|
||||
import { getBaseURL } from '../helpers/url'
|
||||
import { Booking } from '../db/booking'
|
||||
import { IBooking } from '../db/booking'
|
||||
import { getDays, getNextDay, dateFormatBackend } from '../helpers/date'
|
||||
import { log } from '../helpers/log'
|
||||
|
||||
@@ -47,7 +47,7 @@ export async function getBookedDays() {
|
||||
)
|
||||
}
|
||||
|
||||
function getSummary(booking: Partial<Booking>): string {
|
||||
function getSummary(booking: Partial<IBooking>): string {
|
||||
let summary = ''
|
||||
|
||||
if (booking.org) {
|
||||
@@ -59,13 +59,15 @@ function getSummary(booking: Partial<Booking>): string {
|
||||
return summary
|
||||
}
|
||||
|
||||
function getDescription(booking: Booking): string {
|
||||
function getDescription(booking: IBooking): string {
|
||||
const bookingUrl = `${getBaseURL()}/admin/bookings/${booking.uuid}`
|
||||
|
||||
return `Managelink ${bookingUrl}`
|
||||
}
|
||||
|
||||
export async function createCalendarEvent(booking: Booking): Promise<Booking> {
|
||||
export async function createCalendarEvent(
|
||||
booking: IBooking
|
||||
): Promise<IBooking> {
|
||||
const exclusiveEndDate = dateFormatBackend(
|
||||
getNextDay(new Date(booking.endDate))
|
||||
)
|
||||
@@ -85,7 +87,7 @@ export async function createCalendarEvent(booking: Booking): Promise<Booking> {
|
||||
return booking
|
||||
}
|
||||
|
||||
export async function deleteCalendarEvent(booking: Booking) {
|
||||
export async function deleteCalendarEvent(booking: IBooking) {
|
||||
await calendar.events.delete({
|
||||
calendarId,
|
||||
eventId: booking.calendarEventId,
|
||||
@@ -95,12 +97,3 @@ export async function deleteCalendarEvent(booking: Booking) {
|
||||
|
||||
booking.calendarEventId = null
|
||||
}
|
||||
|
||||
//export async function patchCalendarEvent(booking: { calendarEventId: string } & Partial<Booking> ) : Promise<Booking> {
|
||||
// const response = await calendar.events.patch({
|
||||
// calendarId,
|
||||
// eventId: booking.calendarEventId,
|
||||
// });
|
||||
//
|
||||
// return booking;
|
||||
//}
|
||||
Reference in New Issue
Block a user