From 8fded81bcb82404e67b6674cd909634147e52d12 Mon Sep 17 00:00:00 2001 From: Pranav C Date: Wed, 15 Nov 2023 19:30:56 +0000 Subject: [PATCH] fix: add field validation wherever missing --- packages/nocodb/src/db/conditionV2.ts | 2 +- packages/nocodb/src/helpers/getAst.ts | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/packages/nocodb/src/db/conditionV2.ts b/packages/nocodb/src/db/conditionV2.ts index 04441a8021..4495be7cef 100644 --- a/packages/nocodb/src/db/conditionV2.ts +++ b/packages/nocodb/src/db/conditionV2.ts @@ -342,7 +342,7 @@ const parseConditionV2 = async ( return (qbP: Knex.QueryBuilder) => { if (filter.comparison_op in negatedMapping) qbP.where((qb) => - qbP + qb .whereNotIn(childColumn.column_name, selectQb) .orWhereNull(childColumn.column_name), ); diff --git a/packages/nocodb/src/helpers/getAst.ts b/packages/nocodb/src/helpers/getAst.ts index efc0206ae4..95eb299177 100644 --- a/packages/nocodb/src/helpers/getAst.ts +++ b/packages/nocodb/src/helpers/getAst.ts @@ -69,7 +69,9 @@ const getAst = async ({ if (throwErrorIfInvalidParams) { const colAliasMap = await model.getColAliasMapping(); const aliasColMap = await model.getAliasColMapping(); - const invalidFields = fields.filter((f) => !colAliasMap[f] && !aliasColMap[f]); + const invalidFields = fields.filter( + (f) => !colAliasMap[f] && !aliasColMap[f], + ); if (invalidFields.length) { NcError.unprocessableEntity( `Following fields are invalid: ${invalidFields.join(', ')}`,