diff --git a/awx/ui/client/src/inventories-hosts/shared/associate-hosts/associate-hosts.controller.js b/awx/ui/client/src/inventories-hosts/shared/associate-hosts/associate-hosts.controller.js index 785a8cc12e..767b544f98 100644 --- a/awx/ui/client/src/inventories-hosts/shared/associate-hosts/associate-hosts.controller.js +++ b/awx/ui/client/src/inventories-hosts/shared/associate-hosts/associate-hosts.controller.js @@ -70,14 +70,14 @@ let item = value.value; if (value.isSelected) { - $scope.selectedItems.push(item.id); + $scope.selectedItems.push(item); } else { // _.remove() Returns the new array of removed elements. // This will pull all the values out of the array that don't // match the deselected item effectively removing it $scope.selectedItems = _.remove($scope.selectedItems, function(selectedItem) { - return selectedItem !== item.id; + return selectedItem.id !== item.id; }); } });