Trash eklendi

This commit is contained in:
2025-11-02 00:15:06 +03:00
parent 90009d9fbe
commit 3e07e2a270
8 changed files with 2670 additions and 135 deletions

View File

@@ -19,3 +19,36 @@ export async function apiFetch(path, options = {}) {
}
return res;
}
// 🗑️ Çöp API'leri
export async function getTrashItems() {
const res = await apiFetch("/api/trash");
return res.json();
}
export async function restoreFromTrash(trashName) {
const res = await apiFetch("/api/trash/restore", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({ trashName })
});
return res.json();
}
export async function deleteFromTrash(trashName) {
const res = await apiFetch(`/api/trash`, {
method: "DELETE",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({ trashName })
});
return res.json();
}
export async function renameFolder(path, newName) {
const res = await apiFetch("/api/folder", {
method: "PATCH",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({ path, newName })
});
return res.json();
}