mirror of
https://github.com/directus/directus.git
synced 2026-04-25 03:00:53 -04:00
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:
@@ -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]);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user