Skip to content

Commit

Permalink
add timestamp to api request
Browse files Browse the repository at this point in the history
  • Loading branch information
saitergun committed Dec 28, 2020
1 parent f9f1154 commit ca75ff0
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/hooks/useFetchMatches.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ const useFetchMatches = (season = 20202021) => {
fetch(`${state.app.dirPublic}data/matches/${season}.json`)
.then((response) => response.json())
.then((response) => {
window.localStorage.setItem(`fikstur:saved-matches-${season}`, JSON.stringify(response.rows));
window.localStorage.setItem(`fikstur:saved-matches-${season}?version=${Date.now()}`, JSON.stringify(response.rows));

setMatches(response.rows);
})
Expand Down
2 changes: 1 addition & 1 deletion src/hooks/useFetchTeams.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ const useFetchTeams = () => {

useEffect(() => {
if (window.navigator.onLine) {
fetch(`${state.app.dirPublic}data/teams.json`)
fetch(`${state.app.dirPublic}data/teams.json?version=${Date.now()}`)
.then((response) => response.json())
.then((response) => {
window.localStorage.setItem('fikstur:saved-teams', JSON.stringify(response.rows));
Expand Down

0 comments on commit ca75ff0

Please sign in to comment.