Skip to content

Commit

Permalink
fix: changing void to await in use-axios
Browse files Browse the repository at this point in the history
  • Loading branch information
sandrvvu committed Dec 11, 2024
1 parent 63f1a43 commit 3ab7a37
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/hooks/use-axios.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,7 @@ const useAxios = <
const responseData = transform ? transform(res.data) : res.data
setResponse(responseData as TransformedResponse)
setError(null)
// eslint-disable-next-line @typescript-eslint/no-floating-promises
void onResponse?.(responseData as TransformedResponse)
await onResponse?.(responseData as TransformedResponse)
} catch (e) {
const error = e as AxiosError<ErrorResponse>
if (error.response) {
Expand All @@ -75,7 +74,6 @@ const useAxios = <

useEffect(() => {
if (fetchOnMount) {
// eslint-disable-next-line @typescript-eslint/no-floating-promises
void fetchData()
}
}, [fetchData, fetchOnMount])
Expand Down

0 comments on commit 3ab7a37

Please sign in to comment.