From e8b7f00a2a08546593500761a92bcd69a3ee9ebc Mon Sep 17 00:00:00 2001 From: imaimai17468 Date: Sat, 26 Aug 2023 02:04:32 +0900 Subject: [PATCH] =?UTF-8?q?[fix]=20api=E3=81=AE=E3=82=A8=E3=83=A9=E3=83=BC?= =?UTF-8?q?=E6=96=87=E3=82=92=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- view/src/pages/api/parkings/[parkingName].ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/view/src/pages/api/parkings/[parkingName].ts b/view/src/pages/api/parkings/[parkingName].ts index bb73fd2..2a66f24 100644 --- a/view/src/pages/api/parkings/[parkingName].ts +++ b/view/src/pages/api/parkings/[parkingName].ts @@ -8,7 +8,7 @@ const handler = async (req: NextApiRequest, res: NextApiResponse) => { const { method } = req const { parkingName } = req.query if (typeof parkingName !== 'string') throw new Error('parkingName is not string') - if (!isParkingName(parkingName)) throw new Error('parkingName is not valid') + if (!isParkingName(parkingName)) throw new Error('parkingName is not found') switch (method) { case 'GET': { @@ -19,7 +19,7 @@ const handler = async (req: NextApiRequest, res: NextApiResponse) => { break } default: - res.setHeader('Allow', ['GET', 'PUT']) + res.setHeader('Allow', ['GET']) if (method) res.status(405).end(`Method ${method} Not Allowed`) else res.status(405).end(`Method Not Allowed`) }