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

Merge pull request #333 from sasjs/issue-331

fix: stringify json file
This commit is contained in:
Allan Bowe
2022-12-06 14:11:37 +00:00
committed by GitHub

View File

@@ -261,8 +261,10 @@ const useEditor = ({
axios
.get(`/SASjsApi/drive/file?_filePath=${selectedFilePath}`)
.then((res: any) => {
setPrevFileContent(res.data)
setFileContent(res.data)
const content =
typeof res.data === 'object' ? JSON.stringify(res.data) : res.data
setPrevFileContent(content)
setFileContent(content)
})
.catch((err) => {
setModalTitle('Abort')