1
0
mirror of https://github.com/sasjs/server.git synced 2026-01-11 16:20:06 +00:00

feat: add api end point for delete folder

This commit is contained in:
2022-07-19 22:41:03 +05:00
parent 3e53f70928
commit 08e0c61e0f
3 changed files with 72 additions and 0 deletions

View File

@@ -149,6 +149,19 @@ driveRouter.delete('/file', async (req, res) => {
}
})
driveRouter.delete('/folder', async (req, res) => {
const { error: errQ, value: query } = folderParamValidation(req.query)
if (errQ) return res.status(400).send(errQ.details[0].message)
try {
const response = await controller.deleteFolder(query._folderPath)
res.send(response)
} catch (err: any) {
res.status(403).send(err.toString())
}
})
driveRouter.post(
'/file',
(...arg) => multerSingle('file', arg),