From 299319e2dbe06c7ca99e403fcbdec2ad1db8b7e4 Mon Sep 17 00:00:00 2001 From: sabhas Date: Tue, 19 Oct 2021 10:54:27 +0000 Subject: [PATCH] fix: immplementation of files api fixed --- src/routes/index.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/routes/index.ts b/src/routes/index.ts index 9f37342..ae3b72d 100644 --- a/src/routes/index.ts +++ b/src/routes/index.ts @@ -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' }) })