Skip to content

Commit

Permalink
feat: 검색 실패시 에러 메시지를 렌더
Browse files Browse the repository at this point in the history
  • Loading branch information
yeolyi committed Mar 10, 2024
1 parent 0dc5ca2 commit 84ee85d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/[locale]/search/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,6 @@ const countSettled = <T extends { total: number }>(result: PromiseSettledResult<
};

const renderSettled = <T,>(result: PromiseSettledResult<T>, render: (data: T) => ReactNode) => {
if (result.status === 'rejected') return <p>네트워크 에러</p>;
if (result.status === 'rejected') return <p>{result.reason + ''}</p>;
else return render(result.value);
};

0 comments on commit 84ee85d

Please sign in to comment.