Skip to content

Commit c45fa58

Browse files
committed
fix(autosubmission): stop auto submission on initial render
1 parent bb77a04 commit c45fa58

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

web/src/hooks/usePost.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@ import { ENDPOINTS } from "../features/constants";
66
const usePost = (endpoint: ENDPOINTS, data: any) =>
77
useQuery({
88
queryKey: [endpoint],
9-
queryFn: () => apiClient.post(endpoint, data),
9+
queryFn: () =>
10+
data ? apiClient.post(endpoint, data) : Promise.reject("No request data"),
1011
retry: 4,
1112
staleTime: 60,
1213
});

0 commit comments

Comments
 (0)