Skip to content

Commit

Permalink
Merge pull request #134 from serafuku/yunochi/develop
Browse files Browse the repository at this point in the history
🚑 답변 없을때 로딩스피너 대신 오류텍스트 표시 (수정)
  • Loading branch information
yunochi authored Dec 23, 2024
2 parents c96b331 + 6ff5c1c commit 1449eee
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/app/main/user/[handle]/[answer]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit 1449eee

Please sign in to comment.