mirror of
https://github.com/tomru/pfadi-bussle.git
synced 2026-03-03 22:47:15 +01:00
further work on billing
This commit is contained in:
committed by
Thomas Ruoff
parent
f8434233d9
commit
c396cdcbf9
@@ -1,6 +1,6 @@
|
||||
import { NextApiRequest, NextApiResponse } from 'next'
|
||||
import { BillDocument } from '../../../../db/bill'
|
||||
import { createBill } from '../../../../db/index'
|
||||
import { createBill, patchBill } from '../../../../db/index'
|
||||
|
||||
export default async function userHandler(
|
||||
req: NextApiRequest,
|
||||
@@ -26,6 +26,16 @@ export default async function userHandler(
|
||||
return
|
||||
}
|
||||
break
|
||||
case 'PATCH':
|
||||
try {
|
||||
bill = await patchBill(bookingUUID, req.body)
|
||||
res.status(200).json(bill)
|
||||
} catch (e) {
|
||||
console.error(e)
|
||||
res.status(500).end(`Internal Server Error...Guru is meditating...`)
|
||||
return
|
||||
}
|
||||
break
|
||||
default:
|
||||
res.setHeader('Allow', ['POST'])
|
||||
res.status(405).end(`Method ${method} Not Allowed`)
|
||||
|
||||
Reference in New Issue
Block a user