Skip to content

Commit

Permalink
fix forcereload
Browse files Browse the repository at this point in the history
  • Loading branch information
harryob committed Oct 16, 2024
1 parent 3232ec9 commit 67a7f18
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/helpers/api.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
export const callApi = async (toCall: string, init?: RequestInit | undefined): Promise<Response> => {
const response = await fetch(`${import.meta.env.VITE_API_PATH}${toCall}`, init)
if (response.status == 400) {
location.replace(`${location.protocol}//${location.host}${location.pathname}/?forceRefresh=true`)
location.replace(`${location.protocol}//${location.host}/${location.hash}/?forceRefresh=true`)
}
return response
}

0 comments on commit 67a7f18

Please sign in to comment.