From 6ff5c1cdba069664e70ef2726b6486a91fe139d3 Mon Sep 17 00:00:00 2001 From: Yunochi Date: Mon, 23 Dec 2024 15:28:57 +0900 Subject: [PATCH] =?UTF-8?q?=F0=9F=9A=91=20=EB=8B=B5=EB=B3=80=20=EC=97=86?= =?UTF-8?q?=EC=9D=84=EB=95=8C=20=EB=A1=9C=EB=94=A9=EC=8A=A4=ED=94=BC?= =?UTF-8?q?=EB=84=88=20=EB=8C=80=EC=8B=A0=20=EC=98=A4=EB=A5=98=ED=85=8D?= =?UTF-8?q?=EC=8A=A4=ED=8A=B8=20=ED=91=9C=EC=8B=9C=20(=EC=88=98=EC=A0=95)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/app/main/user/[handle]/[answer]/page.tsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/app/main/user/[handle]/[answer]/page.tsx b/src/app/main/user/[handle]/[answer]/page.tsx index c77125d..f66cebb 100644 --- a/src/app/main/user/[handle]/[answer]/page.tsx +++ b/src/app/main/user/[handle]/[answer]/page.tsx @@ -16,7 +16,9 @@ export default function SingleAnswer() { const res = await fetch(`/api/db/answers/${userHandle}/${id}`, { method: 'GET', }); - if (!res.ok) { + if (res.status === 404) { + return null; + } else if (!res.ok) { throw new Error(`Fail to fetch answer! ${await res.text()}`); } return await res.json();