Skip to content

Commit

Permalink
Unique names for query parameters (re #164)
Browse files Browse the repository at this point in the history
  • Loading branch information
Allen Short authored and jezdez committed Aug 14, 2019
1 parent dd1f3af commit f1b3871
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions client/app/services/query.js
Original file line number Diff line number Diff line change
Expand Up @@ -357,7 +357,7 @@ export class Parameter {
return { [`${prefix}${this.name}`]: JSON.stringify(this.value) };
}
return {
[`${prefix}${this.name}`]: this.value,
[`${prefix}${this.name}_${this.parentQueryId}`]: this.value,
[`${prefix}${this.name}.start`]: null,
[`${prefix}${this.name}.end`]: null,
};
Expand All @@ -375,7 +375,7 @@ export class Parameter {
this.setValue([query[keyStart], query[keyEnd]]);
}
} else {
const key = `${prefix}${this.name}`;
const key = `${prefix}${this.name}_${this.parentQueryId}`;
if (has(query, key)) {
if (this.multiValuesOptions) {
try {
Expand Down Expand Up @@ -762,7 +762,7 @@ function QueryResource(
});
}
Object.keys(params).forEach(key => params[key] == null && delete params[key]);
params = map(params, (value, name) => `${encodeURIComponent(name)}=${encodeURIComponent(value)}`).join('&');
params = map(params, (value, name) => `${encodeURIComponent(name)}_${this.id}=${encodeURIComponent(value)}`).join('&');

if (params !== '') {
url += `?${params}`;
Expand Down

0 comments on commit f1b3871

Please sign in to comment.