1
0
mirror of https://github.com/sasjs/server.git synced 2026-01-09 07:20:05 +00:00

fix: get file instead of it's content

This commit is contained in:
Saad Jutt
2022-03-06 02:33:56 +05:00
parent 95843fa4c7
commit efaf38d303
3 changed files with 25 additions and 71 deletions

View File

@@ -32,14 +32,9 @@ driveRouter.get('/file', async (req, res) => {
if (error) return res.status(400).send(error.details[0].message)
try {
const response = await controller.getFile(query.filePath)
res.send(response)
await controller.getFile(req, query.filePath)
} catch (err: any) {
const statusCode = err.code
delete err.code
res.status(statusCode).send(err)
res.status(403).send(err.toString())
}
})