diff --git a/frontend/src/pages/ErrorPage/index.tsx b/frontend/src/pages/ErrorPage/index.tsx index 499d2459c..db0e9f0c5 100644 --- a/frontend/src/pages/ErrorPage/index.tsx +++ b/frontend/src/pages/ErrorPage/index.tsx @@ -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'; @@ -106,6 +107,7 @@ export default function ErrorPage() { const error = useRouteError(); const navigate = useNavigate(); const { clearClubId } = useClubId(); + const queryClient = useQueryClient(); let status; @@ -114,6 +116,7 @@ export default function ErrorPage() { } else if (error instanceof ApiError) { status = error.statusCode; if (status === 401) { + queryClient.clear(); clearClubId(); } } diff --git a/frontend/src/router/AppRouter.tsx b/frontend/src/router/AppRouter.tsx index 257964cad..d68dcbecd 100644 --- a/frontend/src/router/AppRouter.tsx +++ b/frontend/src/router/AppRouter.tsx @@ -80,7 +80,6 @@ export default function AppRouter() { queries: { throwOnError: true, retry: 0, - gcTime: 0, }, mutations: { onError: (error) => {