From 1d45cca6c22c6a0f8c3fcdb50f2c9985459d4730 Mon Sep 17 00:00:00 2001 From: JP Dillingham Date: Sun, 23 Jul 2023 17:46:29 -0500 Subject: add delete functions --- src/web/src/lib/files.js | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'src') diff --git a/src/web/src/lib/files.js b/src/web/src/lib/files.js index 9c147d61..9284fb1b 100644 --- a/src/web/src/lib/files.js +++ b/src/web/src/lib/files.js @@ -4,5 +4,19 @@ export const list = async ({ root, subdirectory = '' }) => { subdirectory = btoa(subdirectory); const response = (await api.get(`/files/${root}/directories/${subdirectory}`)).data; + return response; +}; + +export const deleteDirectory = async ({ root, path }) => { + path = btoa(path); + const response = (await api.delete(`/files/${root}/directories/${path}`)); + + return response; +}; + +export const deleteFile = async ({ root, path }) => { + path = btoa(path); + const response = (await api.delete(`/files/${root}/files/${path}`)); + return response; }; \ No newline at end of file -- cgit v1.2.3