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:
Zachary Wasserman 2016-11-18 09:20:21 -08:00 committed by GitHub
parent 531535c168
commit 6133a61fd1

View File

@ -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 };