diff --git a/apps/common/features/src/pages/(pst)/notice/model/notice-table-columns.tsx b/apps/common/features/src/pages/(pst)/notice/model/notice-table-columns.tsx index 0926a2d9d..e6feb6952 100644 --- a/apps/common/features/src/pages/(pst)/notice/model/notice-table-columns.tsx +++ b/apps/common/features/src/pages/(pst)/notice/model/notice-table-columns.tsx @@ -8,6 +8,12 @@ export const columns: ColumnDef[] = [ { accessorKey: "rowNo", header: "NO", + cell: ({ row, table }) => { + const totalRows = table.getRowCount(); + const currentPage = table.getState().pagination.pageIndex; + const pageSize = table.getState().pagination.pageSize; + return totalRows - (currentPage * pageSize + row.index); + }, }, { accessorKey: "pstTtl", 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 973ce9315..2084b69ac 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 @@ -29,7 +29,7 @@ export const columns: ColumnDef[] = [ { accessorKey: "rowNo", header: "NO", - cell: ({ row }) => { + cell: ({ row, table }) => { if (row.original.isUpndFixPost) { return ( [] = [ ); } - return row.original.rowNo; + const totalRows = table.getRowCount(); + const currentPage = table.getState().pagination.pageIndex; + const pageSize = table.getState().pagination.pageSize; + return totalRows - (currentPage * pageSize + row.index); }, }, { 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 973ce9315..c16f7a931 100644 --- a/apps/cs/src/widgets/post/model/post-table-columns.tsx +++ b/apps/cs/src/widgets/post/model/post-table-columns.tsx @@ -29,7 +29,7 @@ export const columns: ColumnDef[] = [ { accessorKey: "rowNo", header: "NO", - cell: ({ row }) => { + cell: ({ row, table }) => { if (row.original.isUpndFixPost) { return ( [] = [ ); } - return row.original.rowNo; + + const totalRows = table.getRowCount(); + const currentPage = table.getState().pagination.pageIndex; + const pageSize = table.getState().pagination.pageSize; + return totalRows - (currentPage * pageSize + row.index); }, }, { diff --git a/apps/cs/src/widgets/post/ui/post-page.tsx b/apps/cs/src/widgets/post/ui/post-page.tsx index 0a91f08e9..75384ad13 100644 --- a/apps/cs/src/widgets/post/ui/post-page.tsx +++ b/apps/cs/src/widgets/post/ui/post-page.tsx @@ -78,7 +78,7 @@ function PostPage({ bbsId }: { bbsId: string }) { isLoading, refetch, } = useQuery({ - queryKey: [ENDPOINT.BOARD_SERVICE.POSTS, bbsInfo?.bbsTypeCd], + queryKey: [ENDPOINT.BOARD_SERVICE.POSTS, bbsInfo?.bbsTypeCd, pagination], queryFn: () => PostApi.getPostList(parseInt(bbsId), { ...postParams,