mirror of
https://github.com/tomru/pfadi-bussle.git
synced 2026-03-04 15:07:13 +01:00
enable bill storing
This commit is contained in:
committed by
Thomas Ruoff
parent
df6ec51af9
commit
ec1b2e9629
20
pages/api/daysbooked.ts
Normal file
20
pages/api/daysbooked.ts
Normal file
@@ -0,0 +1,20 @@
|
||||
import { NextApiRequest, NextApiResponse } from 'next'
|
||||
import { getBookedDays } from '../../db/index'
|
||||
|
||||
export default async function useHandler(
|
||||
req: NextApiRequest,
|
||||
res: NextApiResponse
|
||||
) {
|
||||
const { method } = req
|
||||
|
||||
switch (method) {
|
||||
case 'GET':
|
||||
const days = await getBookedDays()
|
||||
res.statusCode = 200
|
||||
res.json(days)
|
||||
break
|
||||
default:
|
||||
res.setHeader('Allow', ['GET'])
|
||||
res.status(405).end(`Method ${method} Not Allowed`)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user