From 05c9345e0160013b8fda23119750ae5d3b94be23 Mon Sep 17 00:00:00 2001 From: bicochan Date: Tue, 1 Jul 2025 17:09:40 +0900 Subject: [PATCH] =?UTF-8?q?[apps/cs,=20common/features]=20refactor:=20?= =?UTF-8?q?=EA=B2=8C=EC=8B=9C=EB=AC=BC=20=EC=A1=B0=ED=9A=8C=20api=20'ansUs?= =?UTF-8?q?eYn'=20=ED=8C=8C=EB=9D=BC=EB=AF=B8=ED=84=B0=20=EC=B6=94?= =?UTF-8?q?=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../features/src/entities/post/model/post-interface.ts | 1 + .../features/src/widgets/post/model/post-table-columns.tsx | 5 +++-- apps/common/features/src/widgets/post/ui/post-page.tsx | 1 + apps/cs/src/entities/post/model/post-interface.ts | 1 + apps/cs/src/widgets/post/model/post-table-columns.tsx | 5 +++-- apps/cs/src/widgets/post/ui/post-page.tsx | 1 + 6 files changed, 10 insertions(+), 4 deletions(-) diff --git a/apps/common/features/src/entities/post/model/post-interface.ts b/apps/common/features/src/entities/post/model/post-interface.ts index 11778002f..1b6b14953 100644 --- a/apps/common/features/src/entities/post/model/post-interface.ts +++ b/apps/common/features/src/entities/post/model/post-interface.ts @@ -9,6 +9,7 @@ export interface PostParams extends PageableParams { prdPstgYn?: string; siteId?: string; bbsTypeCd?: string; + ansUseYn?: string; } export interface Post { diff --git a/apps/common/features/src/widgets/post/model/post-table-columns.tsx b/apps/common/features/src/widgets/post/model/post-table-columns.tsx index 2084b69ac..2e4f14d2f 100644 --- a/apps/common/features/src/widgets/post/model/post-table-columns.tsx +++ b/apps/common/features/src/widgets/post/model/post-table-columns.tsx @@ -50,12 +50,13 @@ export const columns: ColumnDef[] = [ accessorKey: "pstTtl", header: "제목", cell: ({ row }) => { - const { ansPstn, pstTtl, inqNocs, cmntCnt } = row.original; + const { ansPstn = 0, pstTtl, inqNocs, cmntCnt } = row.original; + const indentPadding = ansPstn > 0 ? (ansPstn - 1) * 20 : 0; return (
{ansPstn > 0 && (
diff --git a/apps/common/features/src/widgets/post/ui/post-page.tsx b/apps/common/features/src/widgets/post/ui/post-page.tsx index f53af0ee8..3e7d74f04 100644 --- a/apps/common/features/src/widgets/post/ui/post-page.tsx +++ b/apps/common/features/src/widgets/post/ui/post-page.tsx @@ -81,6 +81,7 @@ function PostPage({ bbsId }: { bbsId: string }) { queryFn: () => PostApi.getPostList(parseInt(bbsId), { ...postParams, + ansUseYn: bbsInfo?.ansUseYn, page: pagination.pageIndex, size: pagination.pageSize, }), diff --git a/apps/cs/src/entities/post/model/post-interface.ts b/apps/cs/src/entities/post/model/post-interface.ts index 86e27afd5..783053dd7 100644 --- a/apps/cs/src/entities/post/model/post-interface.ts +++ b/apps/cs/src/entities/post/model/post-interface.ts @@ -9,6 +9,7 @@ export interface PostParams extends PageableParams { prdPstgYn?: string; siteId?: string; bbsTypeCd?: string; + ansUseYn?: string; } export interface RecentPostParams extends PageableParams { diff --git a/apps/cs/src/widgets/post/model/post-table-columns.tsx b/apps/cs/src/widgets/post/model/post-table-columns.tsx index c16f7a931..596fbc1a8 100644 --- a/apps/cs/src/widgets/post/model/post-table-columns.tsx +++ b/apps/cs/src/widgets/post/model/post-table-columns.tsx @@ -51,12 +51,13 @@ export const columns: ColumnDef[] = [ accessorKey: "pstTtl", header: "제목", cell: ({ row }) => { - const { ansPstn, pstTtl, inqNocs, cmntCnt } = row.original; + const { ansPstn = 0, pstTtl, inqNocs, cmntCnt } = row.original; + const indentPadding = ansPstn > 0 ? (ansPstn - 1) * 20 : 0; return (
{ansPstn > 0 && (
diff --git a/apps/cs/src/widgets/post/ui/post-page.tsx b/apps/cs/src/widgets/post/ui/post-page.tsx index 75384ad13..af4a01fc7 100644 --- a/apps/cs/src/widgets/post/ui/post-page.tsx +++ b/apps/cs/src/widgets/post/ui/post-page.tsx @@ -83,6 +83,7 @@ function PostPage({ bbsId }: { bbsId: string }) { PostApi.getPostList(parseInt(bbsId), { ...postParams, bbsTypeCd: bbsInfo?.bbsTypeCd, + ansUseYn: bbsInfo?.ansUseYn, page: pagination.pageIndex, size: pagination.pageSize, }),