mirror of
https://github.com/tomru/pfadi-bussle.git
synced 2026-03-04 06:57:12 +01:00
fix allow header for routes
This commit is contained in:
@@ -39,7 +39,7 @@ export default withSession(async function billHandler(req, res) {
|
|||||||
}
|
}
|
||||||
break
|
break
|
||||||
default:
|
default:
|
||||||
res.setHeader('Allow', ['POST'])
|
res.setHeader('Allow', ['POST', 'PATCH'])
|
||||||
res.status(405).end(`Method ${method} Not Allowed`)
|
res.status(405).end(`Method ${method} Not Allowed`)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -50,7 +50,7 @@ export default async function userHandler(
|
|||||||
res.status(200).json(booking.toJSON())
|
res.status(200).json(booking.toJSON())
|
||||||
break
|
break
|
||||||
default:
|
default:
|
||||||
res.setHeader('Allow', ['POST'])
|
res.setHeader('Allow', ['PATCH'])
|
||||||
res.status(405).end(`Method ${method} Not Allowed`)
|
res.status(405).end(`Method ${method} Not Allowed`)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user