mirror of
https://github.com/nocodb/nocodb.git
synced 2026-04-25 02:25:23 +00:00
@@ -198,7 +198,7 @@ export interface FilterType {
|
||||
logical_op?: string;
|
||||
comparison_op?: string;
|
||||
value?: string | number | boolean | null;
|
||||
is_group?: string | number | null;
|
||||
is_group?: boolean | number | null;
|
||||
children?: FilterType[];
|
||||
project_id?: string;
|
||||
base_id?: string;
|
||||
@@ -214,7 +214,7 @@ export interface FilterReqType {
|
||||
logical_op?: string;
|
||||
comparison_op?: string;
|
||||
value?: string | number | boolean | null;
|
||||
is_group?: string | number | null;
|
||||
is_group?: boolean | number | null;
|
||||
children?: FilterType[];
|
||||
project_id?: string;
|
||||
base_id?: string;
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import { Knex, knex } from 'knex';
|
||||
import { SnowflakeClient } from 'nc-help';
|
||||
import { FilterType } from 'nocodb-sdk';
|
||||
|
||||
const types = require('pg').types;
|
||||
// override parsing date column to Date()
|
||||
@@ -1248,7 +1249,13 @@ knex.QueryBuilder.extend('conditionv2', function (conditionObj: Filter) {
|
||||
return parseConditionv2(conditionObj, this);
|
||||
} as any);
|
||||
|
||||
const parseConditionv2 = (obj: Filter, qb: Knex.QueryBuilder) => {
|
||||
const parseConditionv2 = (_obj: Filter | FilterType, qb: Knex.QueryBuilder) => {
|
||||
let obj: Filter;
|
||||
if (_obj instanceof Filter) {
|
||||
obj = _obj;
|
||||
} else {
|
||||
obj = new Filter(_obj);
|
||||
}
|
||||
if (obj.is_group) {
|
||||
qb = qb.where(function () {
|
||||
const children = obj.children;
|
||||
|
||||
@@ -55,7 +55,7 @@ export default class Filter {
|
||||
value?: string;
|
||||
|
||||
logical_op?: string;
|
||||
is_group?: boolean;
|
||||
is_group?: boolean | number;
|
||||
children?: Filter[];
|
||||
project_id?: string;
|
||||
base_id?: string;
|
||||
|
||||
@@ -8105,7 +8105,7 @@
|
||||
"is_group": {
|
||||
"oneOf": [
|
||||
{
|
||||
"type": "string"
|
||||
"type": "boolean"
|
||||
},
|
||||
{
|
||||
"type": "integer"
|
||||
@@ -8172,7 +8172,7 @@
|
||||
"is_group": {
|
||||
"oneOf": [
|
||||
{
|
||||
"type": "string"
|
||||
"type": "boolean"
|
||||
},
|
||||
{
|
||||
"type": "integer"
|
||||
|
||||
Reference in New Issue
Block a user