Trash eklendi
This commit is contained in:
@@ -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();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user