1
0
mirror of https://github.com/sasjs/server.git synced 2026-01-16 10:20:05 +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 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')