Browse Source

fix: support array of where query params

pull/9348/head
Pranav C 3 months ago
parent
commit
bdc6d26cdb
  1. 12
      packages/nocodb/src/db/BaseModelSqlv2.ts

12
packages/nocodb/src/db/BaseModelSqlv2.ts

@ -9886,6 +9886,18 @@ export function extractFilterFromXwhere(
return []; return [];
} }
// if array treat it as `and` group
if (Array.isArray(str)) {
// calling recursively for nested query
return str.map((s) =>
extractFilterFromXwhere(s, aliasColObjMap, throwErrorIfInvalid),
);
} else if (typeof str !== 'string' && throwErrorIfInvalid) {
throw new Error(
'Invalid filter format. Expected string or array of strings.',
);
}
let nestedArrayConditions = []; let nestedArrayConditions = [];
let openIndex = str.indexOf('(('); let openIndex = str.indexOf('((');

Loading…
Cancel
Save