Skip to content

Commit

Permalink
fix(odata): OData string filter should also support operators
Browse files Browse the repository at this point in the history
  • Loading branch information
ghiscoding committed Feb 28, 2018
1 parent 00f454d commit 0bf8928
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,12 @@ export class GridOdataService implements BackendService {
}
} else if (fieldType === FieldType.string) {
// string field needs to be in single quotes
searchBy = `substringof('${searchValue}', ${fieldNameTitleCase})`;
if (operator === '') {
searchBy = `substringof('${searchValue}', ${fieldNameTitleCase})`;
} else {
// searchBy = `substringof('${searchValue}', ${fieldNameTitleCase}) ${this.mapOdataOperator(operator)} true`;
searchBy = `${fieldNameTitleCase} ${this.mapOdataOperator(operator)} '${searchValue}'`;
}
} else {
// any other field type (or undefined type)
searchValue = fieldType === FieldType.number ? searchValue : `'${searchValue}'`;
Expand Down

0 comments on commit 0bf8928

Please sign in to comment.