From: Galen Charlton Date: Fri, 15 Nov 2019 21:55:59 +0000 (-0500) Subject: improve mapping of filter operators X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=8428b21c63c937c0eb266516ee0421ba654ba2d9;p=working%2FEvergreen.git improve mapping of filter operators Signed-off-by: Galen Charlton --- diff --git a/Open-ILS/src/eg2/src/app/staff/acq/search/acq-search.service.ts b/Open-ILS/src/eg2/src/app/staff/acq/search/acq-search.service.ts index 140b29cfa9..dbad57f875 100644 --- a/Open-ILS/src/eg2/src/app/staff/acq/search/acq-search.service.ts +++ b/Open-ILS/src/eg2/src/app/staff/acq/search/acq-search.service.ts @@ -62,7 +62,10 @@ const searchOptions = { }; const operatorMap = { - "=": "", + ">": "__gte", + ">=": "__gte", + "<=": "__lte", + "<": "__lte", } @Injectable() @@ -83,7 +86,9 @@ export class AcqSearchService { const searchTerm: Object = {}; searchTerm[filterField] = filterVal; - searchTerm[operatorMap[filterOp]] = true; + if (filterOp in operatorMap) { + searchTerm[operatorMap[filterOp]] = true; + } baseSearch[coreRecType].push(searchTerm); }); console.debug(baseSearch);