mirror of
https://github.com/strapi/strapi.git
synced 2025-11-17 18:51:22 +00:00
Remove neg filters
Signed-off-by: soupette <cyril@strapi.io>
This commit is contained in:
parent
bf19bf6b50
commit
e03ea63b64
@ -29,25 +29,12 @@ const FilterList = ({ availableFilters }) => {
|
|||||||
|
|
||||||
let filterType = Object.keys(filter[fieldName])[0];
|
let filterType = Object.keys(filter[fieldName])[0];
|
||||||
let value = filter[fieldName][filterType];
|
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') {
|
if (field.fieldSchema.type === 'relation') {
|
||||||
const relationFieldName = field.fieldSchema.mainField.name;
|
const relationFieldName = field.fieldSchema.mainField.name;
|
||||||
|
|
||||||
filterType = Object.keys(get(filter, [field.name, field.fieldSchema.mainField.name]))[0];
|
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]);
|
value = get(filter, [field.name, relationFieldName, filterType]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -16,6 +16,7 @@ const getFilterList = ({ fieldSchema: { type: fieldType, mainField } }) => {
|
|||||||
{ label: 'is', value: '$eq' },
|
{ label: 'is', value: '$eq' },
|
||||||
{ label: 'is not', value: '$ne' },
|
{ label: 'is not', value: '$ne' },
|
||||||
{ label: 'contains', value: '$contains' },
|
{ label: 'contains', value: '$contains' },
|
||||||
|
// TODO
|
||||||
// { label: 'not contains', value: '$not_$contains' },
|
// { label: 'not contains', value: '$not_$contains' },
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
@ -23,7 +24,7 @@ const getFilterList = ({ fieldSchema: { type: fieldType, mainField } }) => {
|
|||||||
return [
|
return [
|
||||||
{ label: 'is', value: '$eq' },
|
{ label: 'is', value: '$eq' },
|
||||||
{ label: 'is not', value: '$ne' },
|
{ label: 'is not', value: '$ne' },
|
||||||
{ label: 'not contains', value: '$not_$contains' },
|
// { label: 'not contains', value: '$not_$contains' },
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user