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

fix(drive): update file API is same as create file

This commit is contained in:
Saad Jutt
2022-03-14 05:05:59 +05:00
parent 145ac45036
commit 7072e282b1
5 changed files with 247 additions and 59 deletions

View File

@@ -42,11 +42,15 @@ const Main = (props: any) => {
setEditMode(true)
} else {
setIsLoading(true)
const formData = new FormData()
const stringBlob = new Blob([fileContent], { type: 'text/plain' })
formData.append('file', stringBlob, 'filename.sas')
formData.append('filePath', props.selectedFilePath)
axios
.patch(`/SASjsApi/drive/file`, {
filePath: props.selectedFilePath,
fileContent: fileContent
})
.patch(`/SASjsApi/drive/file`, formData)
.then((res) => {
setEditMode(false)
})