Fix: Directories cant be deleted
This commit is contained in:
@@ -108,12 +108,13 @@
|
||||
}
|
||||
|
||||
async function deleteDir() {
|
||||
if (dirToDelete === undefined) return false;
|
||||
return axios
|
||||
.delete(url("/directory"), {
|
||||
headers: {
|
||||
"Content-Type": "application/json"
|
||||
},
|
||||
data: { path: path + (path === "/" ? "" : "/") + dirToDelete?.name },
|
||||
data: { path: path + (path === "/" ? "" : "/") + dirToDelete.name },
|
||||
withCredentials: true
|
||||
})
|
||||
.then((response) => {
|
||||
@@ -255,7 +256,7 @@
|
||||
newFileName = "";
|
||||
}
|
||||
|
||||
function cancel() {
|
||||
function closeRessourceManager() {
|
||||
selectedRessource = undefined;
|
||||
}
|
||||
|
||||
@@ -272,7 +273,7 @@
|
||||
if (selectedRessource) ok({ ...selectedRessource });
|
||||
return true;
|
||||
}}
|
||||
cancelFn={cancel}
|
||||
oncloseFn={closeRessourceManager}
|
||||
okButtonText={selectedRessource !== undefined ? selectedRessource.name : "Ok"}
|
||||
width="90%"
|
||||
height="90%"
|
||||
@@ -331,6 +332,9 @@
|
||||
if (isRessource(ressource)) {
|
||||
showDeleteRessource = true;
|
||||
resToDelete = ressource;
|
||||
} else if (isDir(ressource)) {
|
||||
dirToDelete = ressource;
|
||||
showDeleteDir = true;
|
||||
}
|
||||
}}><i class="fa-solid fa-trash"></i></button
|
||||
>
|
||||
|
||||
Reference in New Issue
Block a user