mirror of
https://github.com/empayre/fleet.git
synced 2024-11-06 17:05:18 +00:00
Fix flatMap logic in target selection request (#512)
The previous logic was causing nulls to be sent as IDs in the request arrays.
This commit is contained in:
parent
531535c168
commit
6133a61fd1
@ -201,10 +201,10 @@ class QueryPage extends Component {
|
||||
dispatch(setSelectedTargetsQuery(query));
|
||||
|
||||
const hosts = flatMap(selectedTargets, (target) => {
|
||||
return target.target_type === 'hosts' ? target.id : null;
|
||||
return target.target_type === 'hosts' ? [target.id] : [];
|
||||
});
|
||||
const labels = flatMap(selectedTargets, (target) => {
|
||||
return target.target_type === 'labels' ? target.id : null;
|
||||
return target.target_type === 'labels' ? [target.id] : [];
|
||||
});
|
||||
const selected = { hosts, labels };
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user