mirror of
https://github.com/sasjs/server.git
synced 2025-12-10 19:34:34 +00:00
chore: code fixes
This commit is contained in:
@@ -395,7 +395,7 @@ const deleteFolder = async (folderPath: string) => {
|
||||
throw new Error('Cannot delete file outside drive.')
|
||||
}
|
||||
|
||||
if (!(await fileExists(folderPathFull))) {
|
||||
if (!(await folderExists(folderPathFull))) {
|
||||
throw new Error('Folder does not exist.')
|
||||
}
|
||||
|
||||
@@ -482,7 +482,7 @@ const rename = async (
|
||||
if (await fileExists(oldPathFull)) {
|
||||
if (await fileExists(newPathFull)) {
|
||||
throw new Error('File already exists.')
|
||||
} else moveFile(oldPath, newPathFull)
|
||||
} else moveFile(oldPathFull, newPathFull)
|
||||
return { status: 'success' }
|
||||
}
|
||||
|
||||
|
||||
@@ -9,6 +9,7 @@ const StaticAuthorizedRoutes = [
|
||||
'/SASjsApi/drive/file',
|
||||
'/SASjsApi/drive/folder',
|
||||
'/SASjsApi/drive/fileTree',
|
||||
'/SASjsApi/drive/rename',
|
||||
'/SASjsApi/permission'
|
||||
]
|
||||
|
||||
|
||||
Reference in New Issue
Block a user