Fully rename Pixeldrain to Nova
This commit is contained in:
@@ -230,6 +230,29 @@ export const fs_delete_all = async (path: string) => {
|
||||
) as GenericResponse
|
||||
}
|
||||
|
||||
export const fs_trash = async (path: string) => {
|
||||
return await fs_check_response(
|
||||
await fetch(fs_path_url(path) + "?trash", { method: "DELETE" })
|
||||
) as GenericResponse
|
||||
}
|
||||
|
||||
export type TrashEntry = {
|
||||
node: FSNode;
|
||||
original_path: string;
|
||||
deletion_date: string;
|
||||
};
|
||||
|
||||
export const fs_get_trash = async (path: string) => {
|
||||
let resp = await fs_check_response(
|
||||
await fetch(fs_path_url(path) + "?trash")
|
||||
) as TrashEntry[]
|
||||
resp.forEach((entry, index) => {
|
||||
resp[index].node = Object.assign(new FSNode(), entry.node)
|
||||
})
|
||||
|
||||
return resp
|
||||
};
|
||||
|
||||
export const fs_search = async (path: string, term: string, limit = 10) => {
|
||||
return await fs_check_response(
|
||||
await fetch(
|
||||
|
||||
Reference in New Issue
Block a user