allow null value comparision only with is

This commit is contained in:
Vik 2023-05-01 20:05:39 +05:30
parent a160e49647
commit da29b52e13
2 changed files with 4 additions and 4 deletions

View file

@ -60,7 +60,7 @@ async function listRows(queryOptions, organizationId, currentState) {
return {
status: 'failed',
statusText: 'failed',
message: 'Null value comparison not allowed with equal/not equal operator, Please use IS operator instead.',
message: 'Null value comparison not allowed, To check null values Please use IS operator instead.',
description: 'Is operator should be used with null value comparision.',
data: {},
};
@ -105,7 +105,7 @@ async function updateRows(queryOptions, organizationId, currentState) {
return {
status: 'failed',
statusText: 'failed',
message: 'Null value comparison not allowed with equal/not equal operator, Please use IS operator instead.',
message: 'Null value comparison not allowed, To check null values Please use IS operator instead.',
description: 'Is operator should be used with null value comparision.',
data: {},
};
@ -131,7 +131,7 @@ async function deleteRows(queryOptions, organizationId, currentState) {
return {
status: 'failed',
statusText: 'failed',
message: 'Null value comparison not allowed with equal/not equal operator, Please use IS operator instead.',
message: 'Null value comparison not allowed, To check null values Please use IS operator instead.',
description: 'Is operator should be used with null value comparision.',
data: {},
};

View file

@ -27,7 +27,7 @@ export const hasEqualWithNull = (queryOptions, operation) => {
const filterKeys = Object.keys(filters);
for (let i = 0; i < filterKeys.length; i++) {
const filter = filters[filterKeys[i]];
if ((filter.operator === 'eq' || filter.operator === 'neq') && filter.value === null) {
if (filter.operator !== 'is' && filter.value === null) {
return true;
}
}