From d4b92a931658f6ddc1cc5d32815d6067190de44a Mon Sep 17 00:00:00 2001 From: Pranav C Date: Mon, 29 May 2023 15:07:07 +0530 Subject: [PATCH] feat: add `filter` query param as an alias for `where` Signed-off-by: Pranav C --- packages/nocodb/src/db/BaseModelSqlv2.ts | 2 +- packages/nocodb/src/db/sql-data-mapper/lib/BaseModel.ts | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/nocodb/src/db/BaseModelSqlv2.ts b/packages/nocodb/src/db/BaseModelSqlv2.ts index d5f1f95852..0d6bec726a 100644 --- a/packages/nocodb/src/db/BaseModelSqlv2.ts +++ b/packages/nocodb/src/db/BaseModelSqlv2.ts @@ -1513,7 +1513,7 @@ class BaseModelSqlv2 { _getListArgs(args: XcFilterWithAlias): XcFilter { const obj: XcFilter = {}; - obj.where = args.where || args.w || ''; + obj.where = args.filter || args.where || args.w || ''; obj.having = args.having || args.h || ''; obj.shuffle = args.shuffle || args.r || ''; obj.condition = args.condition || args.c || {}; diff --git a/packages/nocodb/src/db/sql-data-mapper/lib/BaseModel.ts b/packages/nocodb/src/db/sql-data-mapper/lib/BaseModel.ts index 4da3d275f9..625ba6adab 100644 --- a/packages/nocodb/src/db/sql-data-mapper/lib/BaseModel.ts +++ b/packages/nocodb/src/db/sql-data-mapper/lib/BaseModel.ts @@ -1506,6 +1506,7 @@ abstract class BaseModel { export interface XcFilter { where?: string; + filter?: string; having?: string; condition?: any; conditionGraph?: any;