diff --git a/packages/nocodb/src/db/BaseModelSqlv2.ts b/packages/nocodb/src/db/BaseModelSqlv2.ts index f4ba33ebd5..c5c97660e9 100644 --- a/packages/nocodb/src/db/BaseModelSqlv2.ts +++ b/packages/nocodb/src/db/BaseModelSqlv2.ts @@ -271,6 +271,7 @@ class BaseModelSqlv2 { } = {}, ignoreViewFilterAndSort = false, validateFormula = false, + throwErrorIfInvalidParams = false, ): Promise { const { where, fields, ...rest } = this._getListArgs(args as any); @@ -287,8 +288,16 @@ class BaseModelSqlv2 { } const aliasColObjMap = await this.model.getAliasColObjMap(); - let sorts = extractSortsObject(rest?.sort, aliasColObjMap); - const filterObj = extractFilterFromXwhere(where, aliasColObjMap); + let sorts = extractSortsObject( + rest?.sort, + aliasColObjMap, + throwErrorIfInvalidParams, + ); + const filterObj = extractFilterFromXwhere( + where, + aliasColObjMap, + throwErrorIfInvalidParams, + ); // todo: replace with view id if (!ignoreViewFilterAndSort && this.viewId) { await conditionV2( @@ -311,6 +320,8 @@ class BaseModelSqlv2 { }), ], qb, + undefined, + throwErrorIfInvalidParams, ); if (!sorts) @@ -318,7 +329,7 @@ class BaseModelSqlv2 { ? args.sortArr : await Sort.list({ viewId: this.viewId }); - await sortV2(this, sorts, qb); + await sortV2(this, sorts, qb, undefined, throwErrorIfInvalidParams); } else { await conditionV2( this, @@ -335,11 +346,13 @@ class BaseModelSqlv2 { }), ], qb, + undefined, + throwErrorIfInvalidParams, ); if (!sorts) sorts = args.sortArr; - await sortV2(this, sorts, qb); + await sortV2(this, sorts, qb, undefined, throwErrorIfInvalidParams); } // sort by primary key if not autogenerated string diff --git a/packages/nocodb/src/services/datas.service.ts b/packages/nocodb/src/services/datas.service.ts index 08e5ac60f1..eb5247da00 100644 --- a/packages/nocodb/src/services/datas.service.ts +++ b/packages/nocodb/src/services/datas.service.ts @@ -169,7 +169,7 @@ export class DatasService { try { data = await nocoExecute( ast, - await baseModel.list(listArgs), + await baseModel.list(listArgs, false, false, throwErrorIfInvalidParams), {}, listArgs, );