mirror of
https://github.com/tomru/pfadi-bussle.git
synced 2026-03-03 22:47:15 +01:00
further typing improvements
This commit is contained in:
committed by
Thomas Ruoff
parent
90ac05a907
commit
52a68e9989
@@ -1,13 +1,20 @@
|
||||
import { getBookingByUUID, getBookingByUUIDAsJSON } from '../../../db/index'
|
||||
import { NextApiRequest, NextApiResponse } from 'next'
|
||||
import { Booking } from '../../../db/booking'
|
||||
import { BOOKING_STATUS } from '../../../db/bookingStatus'
|
||||
import { getBookingByUUID, getBookingByUUIDAsJSON } from '../../../db/index'
|
||||
|
||||
export default async function userHandler(req, res) {
|
||||
export default async function userHandler(
|
||||
req: NextApiRequest,
|
||||
res: NextApiResponse
|
||||
) {
|
||||
const {
|
||||
method,
|
||||
query: { uuid },
|
||||
query: { uuids },
|
||||
} = req
|
||||
|
||||
let booking
|
||||
const uuid = Array.isArray(uuids) ? uuids[0] : uuids
|
||||
|
||||
let booking: Booking
|
||||
|
||||
switch (method) {
|
||||
case 'GET':
|
||||
|
||||
@@ -1,12 +1,16 @@
|
||||
import { createBooking } from '../../../db/index'
|
||||
import { Error } from 'mongoose'
|
||||
|
||||
import { NextApiRequest, NextApiResponse } from 'next'
|
||||
import { Booking } from '../../../db/booking'
|
||||
import { createBooking } from '../../../db/index'
|
||||
import { sendReceivedBookingMail } from '../../../helpers/mail'
|
||||
|
||||
export default async function userHandler(req, res) {
|
||||
export default async function userHandler(
|
||||
req: NextApiRequest,
|
||||
res: NextApiResponse
|
||||
) {
|
||||
const { method } = req
|
||||
|
||||
let booking
|
||||
let booking: Booking
|
||||
|
||||
switch (method) {
|
||||
case 'POST':
|
||||
|
||||
@@ -1,8 +1,10 @@
|
||||
// Next.js API route support: https://nextjs.org/docs/api-routes/introduction
|
||||
|
||||
import { NextApiRequest, NextApiResponse } from 'next'
|
||||
import { getBookedDays } from '../../db/index'
|
||||
|
||||
export default async function useHandler(req, res) {
|
||||
export default async function useHandler(
|
||||
req: NextApiRequest,
|
||||
res: NextApiResponse
|
||||
) {
|
||||
const { method } = req
|
||||
|
||||
switch (method) {
|
||||
|
||||
Reference in New Issue
Block a user