Skip to content
This repository has been archived by the owner on Dec 23, 2021. It is now read-only.

Commit

Permalink
fix: $expand($filter) issue
Browse files Browse the repository at this point in the history
  • Loading branch information
Soontao committed Oct 11, 2020
1 parent 1de6600 commit fca8f5c
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/processor/processor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1023,11 +1023,12 @@ export class ODataProcessor extends Transform {
(include && filter && include.query) ||
(!include && this.resourcePath.navigation.indexOf(part) == this.resourcePath.navigation.length - 1)
) {
queryString = Object.keys((include || this).query).map((p) => {
if (p == '$filter' && filter) {
(include || this).query[p] = `(${(include || this).query[p]}) and (${filter})`;
const theQuery = (include ?? this).query;
queryString = Object.keys(theQuery).map((p) => {
if (p === '$filter' && filter) {
return `${p}=(${theQuery[p]}) and (${filter})`;
}
return `${p}=${(include || this).query[p]}`;
return `${p}=${theQuery[p]}`;
}).join('&') || queryString;
}

Expand Down

0 comments on commit fca8f5c

Please sign in to comment.