Add the support of Empty and Non-Empty filter (#5773)
This commit is contained in:
committed by
GitHub
parent
9e08445bff
commit
9228667a57
@ -4,7 +4,31 @@ export const generateILikeFiltersForCompositeFields = (
|
||||
filterString: string,
|
||||
baseFieldName: string,
|
||||
subFields: string[],
|
||||
emptyCheck = false,
|
||||
) => {
|
||||
if (emptyCheck) {
|
||||
return subFields.map((subField) => {
|
||||
return {
|
||||
or: [
|
||||
{
|
||||
[baseFieldName]: {
|
||||
[subField]: {
|
||||
is: 'NULL',
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
[baseFieldName]: {
|
||||
[subField]: {
|
||||
ilike: '',
|
||||
},
|
||||
},
|
||||
},
|
||||
],
|
||||
};
|
||||
});
|
||||
}
|
||||
|
||||
return filterString
|
||||
.split(' ')
|
||||
.reduce((previousValue: RecordGqlOperationFilter[], currentValue) => {
|
||||
|
||||
Reference in New Issue
Block a user