Browse Source

feat: add `filter` query param as an alias for `where`

Signed-off-by: Pranav C <pranavxc@gmail.com>
pull/5901/head
Pranav C 1 year ago
parent
commit
d4b92a9316
  1. 2
      packages/nocodb/src/db/BaseModelSqlv2.ts
  2. 1
      packages/nocodb/src/db/sql-data-mapper/lib/BaseModel.ts

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

@ -1513,7 +1513,7 @@ class BaseModelSqlv2 {
_getListArgs(args: XcFilterWithAlias): XcFilter { _getListArgs(args: XcFilterWithAlias): XcFilter {
const obj: 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.having = args.having || args.h || '';
obj.shuffle = args.shuffle || args.r || ''; obj.shuffle = args.shuffle || args.r || '';
obj.condition = args.condition || args.c || {}; obj.condition = args.condition || args.c || {};

1
packages/nocodb/src/db/sql-data-mapper/lib/BaseModel.ts

@ -1506,6 +1506,7 @@ abstract class BaseModel {
export interface XcFilter { export interface XcFilter {
where?: string; where?: string;
filter?: string;
having?: string; having?: string;
condition?: any; condition?: any;
conditionGraph?: any; conditionGraph?: any;

Loading…
Cancel
Save