darabos commited on
Commit
aac34ad
·
1 Parent(s): 9074266

Fix file deletion in subdirectories.

Browse files
Files changed (1) hide show
  1. lynxkite-app/web/src/Directory.tsx +1 -3
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: pathSlash + item.name }),
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