feat: 가맹몰 상세 목록에서 상세가 없는 행은 선택할 수 없게 한다
선택은 일괄 비활성·삭제를 위한 것이라 상세가 없는 행엔 해당이 없다(사용자 확정). 행 체크박스를 잠그고 전체 선택도 상세가 있는 행만 고른다. Co-Authored-By: Claude Fable 5.1
@34f52ed8ffd9b1fdda62d5625df89dd89c9ada18
--- app/(protected)/(basic)/system/merchant-details/_components/merchant-detail-list.tsx
+++ app/(protected)/(basic)/system/merchant-details/_components/merchant-detail-list.tsx
... | ... | @@ -81,7 +81,8 @@ |
| 81 | 81 |
endDate: query.endDate, |
| 82 | 82 |
}); |
| 83 | 83 |
|
| 84 |
- const allIds = items.map((row) => row.id); |
|
| 84 |
+ // 선택은 일괄 비활성·삭제를 위한 것이라 상세가 있는 행만 고를 수 있다(사용자 확정). |
|
| 85 |
+ const allIds = items.filter((row) => row.hasDetail).map((row) => row.id); |
|
| 85 | 86 |
const isAllSelected = allIds.length > 0 && allIds.every((id) => selectedIds.has(id)); |
| 86 | 87 |
|
| 87 | 88 |
function go(patch: Partial<MerchantDetailQuery>) {
|
... | ... | @@ -179,6 +180,7 @@ |
| 179 | 180 |
label={`${row.name} 선택`}
|
| 180 | 181 |
hideLabel |
| 181 | 182 |
checked={selectedIds.has(row.id)}
|
| 183 |
+ disabled={!row.hasDetail}
|
|
| 182 | 184 |
onChange={(checked) => toggleOne(row.id, checked)}
|
| 183 | 185 |
/> |
| 184 | 186 |
), |
Add a comment
Delete comment
Once you delete this comment, you won't be able to recover it. Are you sure you want to delete this comment?