Skip to content

Commit

Permalink
fix: SearchSubNav에서 전체 개수 표시 여부
Browse files Browse the repository at this point in the history
  • Loading branch information
yeolyi committed Mar 27, 2024
1 parent e24176d commit 51ac1aa
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
6 changes: 5 additions & 1 deletion app/[locale]/search/fetchContent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,11 @@ export default async function fetchContent(keyword: string, tag?: string[]) {

// 서브네비 구성
const node: TreeNode[] = [];
node.push({ name: `전체`, size: tag && total, bold: noTag });
node.push({
name: `전체`,
size: tag === undefined || tag.length === 0 ? total : undefined,
bold: noTag,
});
node.push({
name: `소개`,
size: sectionContent[0]?.total,
Expand Down
2 changes: 1 addition & 1 deletion app/[locale]/search/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export default async function SearchPage({
// 검색 결과 없음 예외 처리
if (total === 0) {
return (
<SearchPageLayout>
<SearchPageLayout node={node}>
<NoSearchResultError />
</SearchPageLayout>
);
Expand Down

0 comments on commit 51ac1aa

Please sign in to comment.