rename js/x ts/x

This commit is contained in:
Thomas Ruoff
2020-08-26 22:36:27 +02:00
committed by Thomas Ruoff
parent 9853e31201
commit be1e22460d
23 changed files with 0 additions and 0 deletions

18
pages/api/daysbooked.tsx Normal file
View File

@@ -0,0 +1,18 @@
// Next.js API route support: https://nextjs.org/docs/api-routes/introduction
import { getBookedDays } from '../../db/index'
export default async function useHandler(req, res) {
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`)
}
}