Remove neg filters

Signed-off-by: soupette <cyril@strapi.io>
This commit is contained in:
soupette 2021-09-15 05:10:37 +02:00
parent bf19bf6b50
commit e03ea63b64
2 changed files with 2 additions and 14 deletions

View File

@ -29,25 +29,12 @@ const FilterList = ({ availableFilters }) => {
let filterType = Object.keys(filter[fieldName])[0];
let value = filter[fieldName][filterType];
// let negFilter = filterType === '$not' ? '$not' : null;
// if (negFilter) {
// filterType = Object.keys(get(filter, [fieldName, negFilter]))[0];
// }
if (field.fieldSchema.type === 'relation') {
const relationFieldName = field.fieldSchema.mainField.name;
filterType = Object.keys(get(filter, [field.name, field.fieldSchema.mainField.name]))[0];
// negFilter = filterType === '$not' ? '$not' : null;
// if (negFilter) {
// filterType = Object.keys(
// get(filter, [fieldName, field.fieldSchema.mainField.name, negFilter])
// )[0];
// }
value = get(filter, [field.name, relationFieldName, filterType]);
}

View File

@ -16,6 +16,7 @@ const getFilterList = ({ fieldSchema: { type: fieldType, mainField } }) => {
{ label: 'is', value: '$eq' },
{ label: 'is not', value: '$ne' },
{ label: 'contains', value: '$contains' },
// TODO
// { label: 'not contains', value: '$not_$contains' },
];
}
@ -23,7 +24,7 @@ const getFilterList = ({ fieldSchema: { type: fieldType, mainField } }) => {
return [
{ label: 'is', value: '$eq' },
{ label: 'is not', value: '$ne' },
{ label: 'not contains', value: '$not_$contains' },
// { label: 'not contains', value: '$not_$contains' },
];
}
default: