From 790eab6728b921e26b8a7bf5bb9298027cdcf4f4 Mon Sep 17 00:00:00 2001 From: gabriellsh Date: Tue, 5 Apr 2022 16:05:36 -0300 Subject: [PATCH 1/2] fix useEndpointUpload hook --- client/hooks/useEndpointUpload.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/client/hooks/useEndpointUpload.ts b/client/hooks/useEndpointUpload.ts index e5a794c309d8..713397b04373 100644 --- a/client/hooks/useEndpointUpload.ts +++ b/client/hooks/useEndpointUpload.ts @@ -7,14 +7,14 @@ export const useEndpointUpload = ( endpoint: string, params = {}, successMessage: string, -): ((...args: any[]) => Promise<{ success: boolean }>) => { +): ((formData: FormData) => Promise<{ success: boolean }>) => { const sendData = useUpload(endpoint); const dispatchToastMessage = useToastMessageDispatch(); return useCallback( - async (...args) => { + async (formData: FormData) => { try { - const data = sendData(params, [...args]); + const data = sendData(params, formData); const promise = data instanceof Promise ? data : data.promise; From 10f66459830a05b2f1d6a99d2a762c0eb595a760 Mon Sep 17 00:00:00 2001 From: dougfabris Date: Wed, 6 Apr 2022 12:18:20 -0300 Subject: [PATCH 2/2] chore: remove log --- client/hooks/useMethodData.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/client/hooks/useMethodData.ts b/client/hooks/useMethodData.ts index 5631a1c4a5c0..0ac1982832c7 100644 --- a/client/hooks/useMethodData.ts +++ b/client/hooks/useMethodData.ts @@ -29,7 +29,6 @@ export const useMethodData = { - console.log('as'); fetchData(); }, [fetchData]);