Skip to content

Commit

Permalink
Merge pull request #3366 from camptocamp/multiple_enum_attributes
Browse files Browse the repository at this point in the history
Accepte multiple enumerate attributes (filters)
  • Loading branch information
ger-benjamin committed Jan 11, 2018
2 parents 19c1156 + 0863a4c commit 89a90a2
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions contribs/gmf/src/services/enumerateattribute.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ gmf.EnumerateAttribute = class {
this.baseUrl_ = gmfLayersUrl;

/**
* @type {Object.<number, !angular.$q.Promise>}
* @type {Object.<string, !angular.$q.Promise>}
* @private
*/
this.promises_ = {};
Expand All @@ -45,14 +45,14 @@ gmf.EnumerateAttribute = class {
* @return {angular.$q.Promise} Promise.
*/
getAttributeValues(dataSource, attribute) {
const id = dataSource.id;
const promiseId = `${dataSource.id}_${attribute}`;
const name = dataSource.name;
if (!this.promises_[id]) {
if (!this.promises_[promiseId]) {
const url = `${this.baseUrl_}/${name}/values/${attribute}`;
this.promises_[id] = this.http_.get(url).then(
this.promises_[promiseId] = this.http_.get(url).then(
this.handleGetAttributeValues_.bind(this));
}
return this.promises_[id];
return this.promises_[promiseId];
}

/**
Expand Down

0 comments on commit 89a90a2

Please sign in to comment.