From 4696e2b710455189dfb9ac8ca7af6d293ddec1e0 Mon Sep 17 00:00:00 2001 From: bicochan Date: Tue, 24 Jun 2025 16:41:56 +0900 Subject: [PATCH] =?UTF-8?q?fix:=20=EA=B7=B8=EB=A3=B9=20=EC=82=AC=EC=9A=A9?= =?UTF-8?q?=EC=9E=90=20key=20=EC=A4=91=EB=B3=B5=20=EC=9D=B4=EC=8A=88=20?= =?UTF-8?q?=ED=95=B4=EA=B2=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/cs/src/pages/groups/ui/group-users-section.tsx | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/apps/cs/src/pages/groups/ui/group-users-section.tsx b/apps/cs/src/pages/groups/ui/group-users-section.tsx index 7b077a570..dc16fda60 100644 --- a/apps/cs/src/pages/groups/ui/group-users-section.tsx +++ b/apps/cs/src/pages/groups/ui/group-users-section.tsx @@ -57,7 +57,6 @@ function GroupUsersSection({ groupId }: GroupUsersSectionProps) { getCoreRowModel: getCoreRowModel(), onPaginationChange: setPagination, onRowSelectionChange: setRowSelection, - getRowId: (row) => row.userUnqId, }, dataTableOptions: { viewPagination: true, @@ -65,15 +64,18 @@ function GroupUsersSection({ groupId }: GroupUsersSectionProps) { }); const handleDeleteSelected = async () => { - const selectedRows = Object.keys(rowSelection); + const selectedRows = table.getSelectedRowModel().rows.map((row) => ({ + groupId: row.original.groupId, + userUnqId: row.original.userUnqId, + })); if (selectedRows.length === 0 || !groupId) return; if (!(await confirm("사용자를 삭제하시겠습니까?"))) return; try { - const usersToDelete = selectedRows.map((userUnqId) => ({ + const usersToDelete = selectedRows.map((row) => ({ mode: "D", - groupId, - userUnqId, + groupId: row.groupId, + userUnqId: row.userUnqId, })); await GroupUsersApi.saveGroupUser(usersToDelete); @@ -90,6 +92,7 @@ function GroupUsersSection({ groupId }: GroupUsersSectionProps) { useEffect(() => { setPagination({ ...pagination, pageIndex: 0 }); + setRowSelection({}); }, [groupId]); return (