Skip to content

Commit

Permalink
fix useEndpointUpload hook
Browse files Browse the repository at this point in the history
  • Loading branch information
gabriellsh committed Apr 5, 2022
1 parent df254a8 commit 790eab6
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions client/hooks/useEndpointUpload.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit 790eab6

Please sign in to comment.