Skip to content

Commit

Permalink
[Refactor] useQuery staletime 추가 #1175
Browse files Browse the repository at this point in the history
  • Loading branch information
Clearsu committed Dec 21, 2023
1 parent 9af59fe commit ba68f3c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pages/tournament.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ export default function Tournament() {
.get('/pingpong/tournaments?size=20&page=1&status=LIVE')
.then((res) => {
if (res.data.tournaments?.length === 1) {
console.log('openInfo');
setOpenTournamentId(res.data.tournaments[0].tournamentId);
}
return res.data;
Expand All @@ -52,11 +51,12 @@ export default function Tournament() {
onError: (error) => {
setError('JJH03');
},
retry: 1,
staleTime: 60000,
}
);

const fetchTournamentGames = useCallback(async () => {
console.log('Fetching more data...');
try {
const res = await instance.get(
`pingpong/tournaments/${openTournamentId}/games`
Expand Down

0 comments on commit ba68f3c

Please sign in to comment.