mirror of
https://github.com/nocodb/nocodb.git
synced 2026-02-01 22:08:33 +00:00
Merge pull request #12984 from nocodb/nc-fix/webhook-blank-array
fix: isBlank for hm lookup
This commit is contained in:
@@ -282,6 +282,18 @@ export async function validateCondition(
|
||||
res = false; // Unsupported operation for User fields
|
||||
}
|
||||
} else {
|
||||
const isBlank = (dataValue: any) => {
|
||||
if (
|
||||
dataValue === '' ||
|
||||
dataValue === null ||
|
||||
dataValue === undefined
|
||||
) {
|
||||
return true;
|
||||
} else if (Array.isArray(dataValue)) {
|
||||
return dataValue.filter((v) => !isBlank(v)).length === 0;
|
||||
}
|
||||
return false;
|
||||
};
|
||||
switch (filter.comparison_op) {
|
||||
case 'eq':
|
||||
res = val == filter.value;
|
||||
@@ -305,18 +317,11 @@ export async function validateCondition(
|
||||
break;
|
||||
case 'empty':
|
||||
case 'blank':
|
||||
res =
|
||||
data[field] === '' ||
|
||||
data[field] === null ||
|
||||
data[field] === undefined;
|
||||
res = isBlank(data[field]);
|
||||
break;
|
||||
case 'notempty':
|
||||
case 'notblank':
|
||||
res = !(
|
||||
data[field] === '' ||
|
||||
data[field] === null ||
|
||||
data[field] === undefined
|
||||
);
|
||||
res = !isBlank(data[field]);
|
||||
break;
|
||||
case 'checked':
|
||||
res = !!data[field];
|
||||
|
||||
Reference in New Issue
Block a user