From 7e0295d559a6ada3fb8550969df607e4cfe5f365 Mon Sep 17 00:00:00 2001 From: hamo-o Date: Fri, 29 Sep 2023 22:23:41 +0900 Subject: [PATCH 1/3] =?UTF-8?q?fix:=20QSet=20=EC=83=9D=EC=84=B1=20?= =?UTF-8?q?=EB=A1=9C=EC=A7=81=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/hooks/questions/useQsetCursorQuery.ts | 6 +- src/hooks/questions/useQsetMutation.ts | 4 +- .../home/components/MakeOfficial.tsx | 112 +++++++++++------- src/pages-edit/home/components/QfeedFrame.tsx | 6 +- 4 files changed, 76 insertions(+), 52 deletions(-) diff --git a/src/hooks/questions/useQsetCursorQuery.ts b/src/hooks/questions/useQsetCursorQuery.ts index 9ef4ce1..38ba652 100644 --- a/src/hooks/questions/useQsetCursorQuery.ts +++ b/src/hooks/questions/useQsetCursorQuery.ts @@ -8,7 +8,11 @@ const useQsetCursorQuery = () => { data: questionCursor, isLoading, refetch - } = useQuery(QSetCursorKeys.all, getQsetCursor); + } = useQuery(QSetCursorKeys.all, getQsetCursor, { + onError: (error: any) => { + console.log(error); + } + }); return { questionCursor, isLoading, refetch }; }; diff --git a/src/hooks/questions/useQsetMutation.ts b/src/hooks/questions/useQsetMutation.ts index 9731c2e..d55b3af 100644 --- a/src/hooks/questions/useQsetMutation.ts +++ b/src/hooks/questions/useQsetMutation.ts @@ -12,7 +12,9 @@ const useQsetMutation = () => { queryClient.invalidateQueries(QSetCursorKeys.all); }, onError: (error: any) => { - console.log(error); + if (error === "AxiosError: Request failed with status code 404") { + return 0; + } } }); }; diff --git a/src/pages-edit/home/components/MakeOfficial.tsx b/src/pages-edit/home/components/MakeOfficial.tsx index 5e9a766..c2899cb 100644 --- a/src/pages-edit/home/components/MakeOfficial.tsx +++ b/src/pages-edit/home/components/MakeOfficial.tsx @@ -28,50 +28,70 @@ const MakeOfficial = (props: QuestionProps) => { const newQSet = useQsetMutation(); const [endTime, setEndTime] = useState(NaN); - // const [time, setTime] = useState