From 2a3a07214a6941d055bf15a260acfb693b4c84c8 Mon Sep 17 00:00:00 2001 From: Jeff McMillen Date: Fri, 6 Dec 2024 10:15:49 -0600 Subject: [PATCH] Ensured a Promise is returned --- client/src/hooks/datafiles/mutations/useTrash.ts | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/client/src/hooks/datafiles/mutations/useTrash.ts b/client/src/hooks/datafiles/mutations/useTrash.ts index f87fd123b..546d2dfc8 100644 --- a/client/src/hooks/datafiles/mutations/useTrash.ts +++ b/client/src/hooks/datafiles/mutations/useTrash.ts @@ -16,7 +16,7 @@ export async function trashUtil({ system: string; path: string; homeDir: string; -}) { +}): Promise<{ file: any; path: string }> { const url = `/api/datafiles/${api}/trash/${scheme}/${system}/${path}/`; const body = { homeDir: homeDir, @@ -27,15 +27,6 @@ export async function trashUtil({ }, withCredentials: true, }); - // const request = await fetch(url, { - // method: 'PUT', - // headers: { 'X-CSRFToken': Cookies.get('csrftoken') || '' }, - // credentials: 'same-origin', - // body: JSON.stringify({ - // homeDir: homeDir, - // }), - // }); - // const request = await apiClient.put(url, body); return response.data; }