_getGroupSuggestions()

in gr-serviceuser/gr-serviceuser-detail.js [233:254]


  _getGroupSuggestions(input) {
    let query;
    if (!input || input === this._getOwnerGroup(this._serviceUser)) {
      query = '';
    } else {
      query = `?suggest=${input}`;
    }

    return this.plugin.restApi('/a/groups/').get(query)
        .then(response => {
          const groups = [];
          for (const key in response) {
            if (!response.hasOwnProperty(key)) { continue; }
            groups.push({
              name: key,
              value: decodeURIComponent(response[key].id),
            });
          }
          this._availableOwners = groups;
          return groups;
        });
  }