mirror of
https://github.com/tomru/pfadi-bussle.git
synced 2026-03-03 22:47:15 +01:00
further code improvements
This commit is contained in:
committed by
Thomas Ruoff
parent
52a68e9989
commit
4b16e07985
@@ -1,7 +1,7 @@
|
||||
import { NextApiRequest, NextApiResponse } from 'next'
|
||||
import { Booking } from '../../../db/booking'
|
||||
import { BOOKING_STATUS } from '../../../db/bookingStatus'
|
||||
import { getBookingByUUID, getBookingByUUIDAsJSON } from '../../../db/index'
|
||||
import { getBookingByUUID } from '../../../db/index'
|
||||
|
||||
export default async function userHandler(
|
||||
req: NextApiRequest,
|
||||
@@ -9,7 +9,7 @@ export default async function userHandler(
|
||||
) {
|
||||
const {
|
||||
method,
|
||||
query: { uuids },
|
||||
query: { uuid: uuids },
|
||||
} = req
|
||||
|
||||
const uuid = Array.isArray(uuids) ? uuids[0] : uuids
|
||||
@@ -17,10 +17,6 @@ export default async function userHandler(
|
||||
let booking: Booking
|
||||
|
||||
switch (method) {
|
||||
case 'GET':
|
||||
booking = await getBookingByUUIDAsJSON(uuid)
|
||||
res.status(200).json(booking)
|
||||
break
|
||||
case 'PATCH':
|
||||
booking = await getBookingByUUID(uuid)
|
||||
const readonlyProps = Object.keys(req.body).filter(
|
||||
|
||||
Reference in New Issue
Block a user