Skip to content

Commit

Permalink
refactor-fe: Tanstack Query 데이터 캐싱 정책 변경 (#947)
Browse files Browse the repository at this point in the history
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Jeongwoo Park <wahoo9040@naver.com>
  • Loading branch information
github-actions[bot] and lurgi authored Nov 17, 2024
1 parent 08d41b8 commit 6b4e55c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
3 changes: 3 additions & 0 deletions frontend/src/pages/ErrorPage/index.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { useQueryClient } from '@tanstack/react-query';
import ApiError from '@api/ApiError';
import Button from '@components/_common/atoms/Button';
import { ButtonColor } from '@components/_common/atoms/Button/style';
Expand Down Expand Up @@ -106,6 +107,7 @@ export default function ErrorPage() {
const error = useRouteError();
const navigate = useNavigate();
const { clearClubId } = useClubId();
const queryClient = useQueryClient();

let status;

Expand All @@ -114,6 +116,7 @@ export default function ErrorPage() {
} else if (error instanceof ApiError) {
status = error.statusCode;
if (status === 401) {
queryClient.clear();
clearClubId();
}
}
Expand Down
1 change: 0 additions & 1 deletion frontend/src/router/AppRouter.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,6 @@ export default function AppRouter() {
queries: {
throwOnError: true,
retry: 0,
gcTime: 0,
},
mutations: {
onError: (error) => {
Expand Down

0 comments on commit 6b4e55c

Please sign in to comment.