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

fix: stringify json file

This commit is contained in:
2022-12-06 18:55:01 +05:00
parent 518815acf1
commit 1192583843

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')