mirror of
https://github.com/sasjs/server.git
synced 2026-01-14 01:10:05 +00:00
fix: update api calls from client side
This commit is contained in:
@@ -34,7 +34,7 @@ driveRouter.post('/deploy', async (req, res) => {
|
|||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
driveRouter.get('/files', async (req, res) => {
|
driveRouter.get('/file', async (req, res) => {
|
||||||
if (isFileQuery(req.query)) {
|
if (isFileQuery(req.query)) {
|
||||||
const filePath = path
|
const filePath = path
|
||||||
.join(getTmpFilesFolderPath(), req.query.filePath)
|
.join(getTmpFilesFolderPath(), req.query.filePath)
|
||||||
@@ -59,7 +59,7 @@ driveRouter.get('/files', async (req, res) => {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
driveRouter.patch('/files', async (req, res) => {
|
driveRouter.patch('/file', async (req, res) => {
|
||||||
const filePath = path
|
const filePath = path
|
||||||
.join(getTmpFilesFolderPath(), req.body.filePath)
|
.join(getTmpFilesFolderPath(), req.body.filePath)
|
||||||
.replace(new RegExp('/', 'g'), path.sep)
|
.replace(new RegExp('/', 'g'), path.sep)
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ const Main = (props: any) => {
|
|||||||
if (props.selectedFilePath) {
|
if (props.selectedFilePath) {
|
||||||
setIsLoading(true)
|
setIsLoading(true)
|
||||||
axios
|
axios
|
||||||
.get(`/SASjsApi/files?filePath=${props.selectedFilePath}`)
|
.get(`/SASjsApi/drive/file?filePath=${props.selectedFilePath}`)
|
||||||
.then((res: any) => {
|
.then((res: any) => {
|
||||||
setFileContent(res.data.fileContent)
|
setFileContent(res.data.fileContent)
|
||||||
})
|
})
|
||||||
@@ -42,7 +42,7 @@ const Main = (props: any) => {
|
|||||||
} else {
|
} else {
|
||||||
setIsLoading(true)
|
setIsLoading(true)
|
||||||
axios
|
axios
|
||||||
.post(`/SASjsApi/files`, {
|
.patch(`/SASjsApi/drive/file`, {
|
||||||
filePath: props.selectedFilePath,
|
filePath: props.selectedFilePath,
|
||||||
fileContent: fileContent
|
fileContent: fileContent
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -51,7 +51,7 @@ const SideBar = (props: any) => {
|
|||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
axios
|
axios
|
||||||
.get(`/SASjsApi/executor`)
|
.get(`/SASjsApi/drive/fileTree`)
|
||||||
.then((res: any) => {
|
.then((res: any) => {
|
||||||
if (res.data && res.data?.status === 'success') {
|
if (res.data && res.data?.status === 'success') {
|
||||||
setDirectoryData(res.data.tree)
|
setDirectoryData(res.data.tree)
|
||||||
|
|||||||
Reference in New Issue
Block a user