1
0
mirror of https://github.com/sasjs/server.git synced 2025-12-10 11:24:35 +00:00

fix: immplementation of files api fixed

This commit is contained in:
2021-10-19 10:54:27 +00:00
parent d713d04b20
commit 299319e2db

View File

@@ -65,7 +65,10 @@ router.get('/SASjsApi/files', async (req, res) => {
})
router.post('/SASjsApi/files', async (req, res) => {
await sasjsDrive(req.body.filePath as string, 'update', req.body.fileContent)
const filePath = path
.join(getTmpFilesFolderPath(), req.body.filePath)
.replace(new RegExp('/', 'g'), path.sep)
await sasjsDrive(filePath, 'update', req.body.fileContent)
res.status(200).send({ status: 'success' })
})