Fix advanced filter

This commit is contained in:
rijkvanzanten
2020-07-30 14:49:40 -04:00
parent b901a7acd3
commit 1bd2939e5d
3 changed files with 11 additions and 2 deletions

View File

@@ -245,6 +245,14 @@ function applyFilter(dbQuery: QueryBuilder, filter: Filter) {
dbQuery.whereNot({ [key]: compareValue });
}
if (operator === '_contains') {
dbQuery.where(key, 'like', `%${compareValue}%`);
}
if (operator === '_ncontains') {
dbQuery.where(key, 'like', `%${compareValue}%`);
}
if (operator === '_in') {
let value = compareValue;
if (typeof value === 'string') value = value.split(',');