1
0
mirror of https://github.com/sasjs/server.git synced 2026-04-10 15:43:14 +00:00

fix: DELETE req cannot have body

This commit is contained in:
Saad Jutt
2022-03-28 05:05:03 +05:00
parent 6dc39c0d91
commit 0a5aeceab5
4 changed files with 5 additions and 29 deletions

View File

@@ -57,12 +57,11 @@ driveRouter.get('/file', async (req, res) => {
driveRouter.delete('/file', async (req, res) => {
const { error: errQ, value: query } = fileParamValidation(req.query)
const { error: errB, value: body } = fileBodyValidation(req.body)
if (errQ && errB) return res.status(400).send(errQ.details[0].message)
if (errQ) return res.status(400).send(errQ.details[0].message)
try {
const response = await controller.deleteFile(query._filePath, body.filePath)
const response = await controller.deleteFile(query._filePath)
res.send(response)
} catch (err: any) {
res.status(403).send(err.toString())