From 6b4e55c8d8578b8899312bd81815fe99602c205c Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sun, 17 Nov 2024 10:47:42 +0900 Subject: [PATCH] =?UTF-8?q?refactor-fe:=20=20Tanstack=20Query=20=EB=8D=B0?= =?UTF-8?q?=EC=9D=B4=ED=84=B0=20=EC=BA=90=EC=8B=B1=20=EC=A0=95=EC=B1=85=20?= =?UTF-8?q?=EB=B3=80=EA=B2=BD=20=20(#947)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Jeongwoo Park --- frontend/src/pages/ErrorPage/index.tsx | 3 +++ frontend/src/router/AppRouter.tsx | 1 - 2 files changed, 3 insertions(+), 1 deletion(-) 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) => {