mirror of
https://github.com/tomru/pfadi-bussle.git
synced 2026-03-03 06:27:11 +01:00
improve logging?
This commit is contained in:
committed by
Thomas Ruoff
parent
942066bc7a
commit
00002a62d2
@@ -1,6 +1,7 @@
|
||||
import { NextApiRequest, NextApiResponse } from 'next'
|
||||
import { Bill } from '../../../../db/bill'
|
||||
import { createBill, patchBill } from '../../../../db/index'
|
||||
import { log } from '../../../../helpers/log'
|
||||
|
||||
export default async function billHandler(
|
||||
req: NextApiRequest,
|
||||
@@ -20,7 +21,7 @@ export default async function billHandler(
|
||||
bill = await createBill(bookingUUID, req.body)
|
||||
res.status(200).json(bill)
|
||||
} catch (e) {
|
||||
console.error(e)
|
||||
log.error('Failed to store bill', e)
|
||||
res.status(500).end(`Internal Server Error...Guru is meditating...`)
|
||||
return
|
||||
}
|
||||
@@ -30,7 +31,7 @@ export default async function billHandler(
|
||||
bill = await patchBill(bookingUUID, req.body)
|
||||
res.status(200).json(bill)
|
||||
} catch (e) {
|
||||
console.error(e)
|
||||
log.error('Failed to patch bill', e)
|
||||
res.status(500).end(`Internal Server Error...Guru is meditating...`)
|
||||
return
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user