Spaces:
Running
Running
Fix file deletion in subdirectories.
Browse files
lynxkite-app/web/src/Directory.tsx
CHANGED
@@ -107,13 +107,11 @@ export default function () {
|
|
107 |
|
108 |
async function deleteItem(item: DirectoryEntry) {
|
109 |
if (!window.confirm(`Are you sure you want to delete "${item.name}"?`)) return;
|
110 |
-
const pathSlash = path ? `${path}/` : "";
|
111 |
-
|
112 |
const apiPath = item.type === "directory" ? "/api/dir/delete" : "/api/delete";
|
113 |
await fetch(apiPath, {
|
114 |
method: "POST",
|
115 |
headers: { "Content-Type": "application/json" },
|
116 |
-
body: JSON.stringify({ path:
|
117 |
});
|
118 |
}
|
119 |
|
|
|
107 |
|
108 |
async function deleteItem(item: DirectoryEntry) {
|
109 |
if (!window.confirm(`Are you sure you want to delete "${item.name}"?`)) return;
|
|
|
|
|
110 |
const apiPath = item.type === "directory" ? "/api/dir/delete" : "/api/delete";
|
111 |
await fetch(apiPath, {
|
112 |
method: "POST",
|
113 |
headers: { "Content-Type": "application/json" },
|
114 |
+
body: JSON.stringify({ path: item.name }),
|
115 |
});
|
116 |
}
|
117 |
|