1
0
mirror of https://github.com/sasjs/server.git synced 2025-12-11 11:44: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 axios
.get(`/SASjsApi/drive/file?_filePath=${selectedFilePath}`) .get(`/SASjsApi/drive/file?_filePath=${selectedFilePath}`)
.then((res: any) => { .then((res: any) => {
setPrevFileContent(res.data) const content =
setFileContent(res.data) typeof res.data === 'object' ? JSON.stringify(res.data) : res.data
setPrevFileContent(content)
setFileContent(content)
}) })
.catch((err) => { .catch((err) => {
setModalTitle('Abort') setModalTitle('Abort')