diff --git a/static/js/directives/ui/entity-search.js b/static/js/directives/ui/entity-search.js index 874908848..633ff4af7 100644 --- a/static/js/directives/ui/entity-search.js +++ b/static/js/directives/ui/entity-search.js @@ -78,7 +78,9 @@ angular.module('quay').directive('entitySearch', function () { // Note: We load the org here again so that we always have the fully up-to-date // teams list. ApiService.getOrganization(null, {'orgname': $scope.namespace}).then(function(resp) { - $scope.teams = resp.teams; + $scope.teams = Object.keys(resp.teams).map(function(key) { + return resp.teams[key]; + }); }); } @@ -113,7 +115,7 @@ angular.module('quay').directive('entitySearch', function () { $scope.handleTeamCreated = function(created) { $scope.setEntity(created.name, 'team', false, created.avatar); - $scope.teams[created.name] = created; + $scope.teams.push(created); }; $scope.handleRobotCreated = function(created) {