fix: translate __orphan__ sentinel to null in bulk move; ungrouped units now fully bulk-operable
This commit is contained in:
@@ -125,12 +125,14 @@
|
||||
if (bulkAction === 'move') {
|
||||
if (!bulkMoveTargetGroupId || checkedUnitIds.size === 0) return;
|
||||
formError = null;
|
||||
// '__orphan__' is the sentinel value for "move to ungrouped" (group: null)
|
||||
const targetGroup = bulkMoveTargetGroupId === '__orphan__' ? null : bulkMoveTargetGroupId;
|
||||
const results = await Promise.all(
|
||||
[...checkedUnitIds].map((unitId) =>
|
||||
fetch(`/admin/api/units/${unitId}`, {
|
||||
method: 'PUT',
|
||||
headers: { 'Content-Type': 'application/json' },
|
||||
body: JSON.stringify({ group: bulkMoveTargetGroupId })
|
||||
body: JSON.stringify({ group: targetGroup })
|
||||
})
|
||||
)
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user