Add support to insensitive case operators (#11737)

* feat: refactor apply-query & implements icontains

* feat: implements icontains in app

* New translations en-US.yaml

* tests: fix returns the filter operators for binary

* implement rest insensitive operators

* fix: proposal to fix #5996 (convert "in" into "exists")

* delete unused imports

* fix: prevent error when operator filter value is null

* fix: apply-query imports

* some tests

* fix: _nstarts_with not applied correctly

* tests: add some filter mathematical tests
This commit is contained in:
Bernat Vadell
2022-05-18 15:58:53 +02:00
committed by GitHub
parent 79ddd35fe0
commit 7e1b946b20
42 changed files with 914 additions and 154 deletions

View File

@@ -92,6 +92,10 @@ export default function generateJoi(filter: Record<string, any> | null, options?
schema[key] = Joi.string().contains(Object.values(value)[0]);
}
if (operator === '_icontains') {
schema[key] = Joi.string().contains(Object.values(value)[0]);
}
if (operator === '_ncontains') {
schema[key] = Joi.string().ncontains(Object.values(value)[0]);
}