diff options
| author | JP Dillingham <jp@dillingham.me> | 2023-07-23 17:46:29 -0500 |
|---|---|---|
| committer | JP Dillingham <jp@dillingham.me> | 2023-07-23 17:46:29 -0500 |
| commit | 1d45cca6c22c6a0f8c3fcdb50f2c9985459d4730 (patch) | |
| tree | 3e2f34fca4e3c342ab0530e23a1e87de29231efa /src/web | |
| parent | 71ba3c4fe31912c6c8934b51d20f0320b386e8ff (diff) | |
| download | slskd-1d45cca6c22c6a0f8c3fcdb50f2c9985459d4730.tar.gz | |
add delete functions
Diffstat (limited to 'src/web')
| -rw-r--r-- | src/web/src/lib/files.js | 14 |
1 files changed, 14 insertions, 0 deletions
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 @@ -5,4 +5,18 @@ export const list = async ({ root, 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 |
