Merge pull request #3708 from jrsupplee/issue-3698

Bug fix for issue #3698
This commit is contained in:
Lauri Ojansivu 2021-04-14 00:35:43 +03:00 committed by GitHub
commit e709094533
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 104 additions and 176 deletions

View file

@ -53,7 +53,9 @@ export class QueryParams {
hasOperator(operator) {
return (
this.params[operator] !== undefined && this.params[operator].length > 0
this.params[operator] !== undefined &&
(this.params[operator].length === undefined ||
this.params[operator].length > 0)
);
}
@ -69,7 +71,11 @@ export class QueryParams {
}
getPredicate(operator) {
return this.params[operator][0];
if (typeof this.params[operator] === 'object') {
return this.params[operator][0];
} else {
return this.params[operator];
}
}
getPredicates(operator) {
@ -198,6 +204,10 @@ export class Query {
return this.queryParams;
}
setQueryParams(queryParams) {
this.queryParams = queryParams;
}
addPredicate(operator, predicate) {
this.queryParams.addPredicate(operator, predicate);
}