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