[apps/cs, common/features] refactor: 게시물 조회 api 'ansUseYn' 파라미터 추가

This commit is contained in:
2025-07-01 17:09:40 +09:00
parent de0958acbe
commit 05c9345e01
6 changed files with 10 additions and 4 deletions
@@ -9,6 +9,7 @@ export interface PostParams extends PageableParams {
prdPstgYn?: string;
siteId?: string;
bbsTypeCd?: string;
ansUseYn?: string;
}
export interface Post {
@@ -50,12 +50,13 @@ export const columns: ColumnDef<Post & { isUpndFixPost?: boolean }>[] = [
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 (
<div
className="flex min-w-[20vw] items-center gap-2 text-left"
style={{ paddingInlineStart: `${(ansPstn - 1) * 20}px` }}
style={{ paddingInlineStart: `${indentPadding}px` }}
>
{ansPstn > 0 && (
<div className="flex items-center gap-1">
@@ -81,6 +81,7 @@ function PostPage({ bbsId }: { bbsId: string }) {
queryFn: () =>
PostApi.getPostList(parseInt(bbsId), {
...postParams,
ansUseYn: bbsInfo?.ansUseYn,
page: pagination.pageIndex,
size: pagination.pageSize,
}),
@@ -9,6 +9,7 @@ export interface PostParams extends PageableParams {
prdPstgYn?: string;
siteId?: string;
bbsTypeCd?: string;
ansUseYn?: string;
}
export interface RecentPostParams extends PageableParams {
@@ -51,12 +51,13 @@ export const columns: ColumnDef<Post & { isUpndFixPost?: boolean }>[] = [
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 (
<div
className="flex min-w-[20vw] items-center gap-2 text-left"
style={{ paddingInlineStart: `${(ansPstn - 1) * 20}px` }}
style={{ paddingInlineStart: `${indentPadding}px` }}
>
{ansPstn > 0 && (
<div className="flex items-center gap-1">
@@ -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,
}),