From c451c27c880dea0957298c69493d6e640ba59e40 Mon Sep 17 00:00:00 2001 From: anjaemin Date: Wed, 2 Nov 2022 15:44:33 +0900 Subject: [PATCH 1/2] =?UTF-8?q?feat:=20catch=EC=B6=94=EA=B0=80,=20fix:=20r?= =?UTF-8?q?es=20console=20=EC=82=AD=EC=A0=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/api/index.tsx | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/src/pages/api/index.tsx b/src/pages/api/index.tsx index 05ed1a1..2dbe97d 100644 --- a/src/pages/api/index.tsx +++ b/src/pages/api/index.tsx @@ -14,13 +14,16 @@ export const ApiPage: React.FC = () => { await axios({ method: 'get', url: 'https://tfb.minpeter.cf/info', - }).then((res) => { - console.log(res.data); - setApiInfo(res.data); - setTimeout(() => { - setLoading(true); //loading 확인하고싶으면 false로 바꿔주세요. - }, 1200); - }); + }) + .then((res) => { + setApiInfo(res.data); + setTimeout(() => { + setLoading(true); //loading 확인하고싶으면 false로 바꿔주세요. + }, 1200); + }) + .catch((err) => { + console.log(err); + }); }; useEffect(() => { From 3ef541cbb62f9c2aabd0240e45dfcc35160d24b5 Mon Sep 17 00:00:00 2001 From: anjaemin Date: Wed, 2 Nov 2022 15:45:19 +0900 Subject: [PATCH 2/2] =?UTF-8?q?fix:=20404=20=ED=8E=98=EC=9D=B4=EC=A7=80=20?= =?UTF-8?q?=EC=9D=B4=EB=8F=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/postApi/index.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pages/postApi/index.tsx b/src/pages/postApi/index.tsx index 000dc17..847c297 100644 --- a/src/pages/postApi/index.tsx +++ b/src/pages/postApi/index.tsx @@ -20,7 +20,7 @@ export const ApiPostPage: React.FC = () => { }) .then((res) => { if (res.data?.message === 'invalid api name') { - navigate('/'); //나중에 404페이지로 이동하게 + navigate('/404'); //나중에 404페이지로 이동하게 } else { setApiInfo(res.data); setTimeout(() => {