1
0
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:
2022-07-21 23:03:40 +05:00
parent 72140d73c2
commit 03cb89d14f
3 changed files with 11 additions and 12 deletions

View File

@@ -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' }
}

View File

@@ -9,6 +9,7 @@ const StaticAuthorizedRoutes = [
'/SASjsApi/drive/file',
'/SASjsApi/drive/folder',
'/SASjsApi/drive/fileTree',
'/SASjsApi/drive/rename',
'/SASjsApi/permission'
]