Browse Source

fix: throw error if invalid operator used in xcCondition (#8568)

* fix: throw error if invalid operator used in xcCondition

* fix: update error message

* fix: use NcError

* fix: use NcError

* fix: use metaError
pull/8618/head
Anbarasu 6 months ago committed by GitHub
parent
commit
25db00bff9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 6
      packages/nocodb/src/db/CustomKnex.ts

6
packages/nocodb/src/db/CustomKnex.ts

@ -4,6 +4,7 @@ import dayjs from 'dayjs';
import type { FilterType } from 'nocodb-sdk';
import type { BaseModelSql } from '~/db/BaseModelSql';
import Filter from '~/models/Filter';
import { NcError } from '~/helpers/catchError';
// refer : https://github.com/brianc/node-pg-types/blob/master/lib/builtins.js
const pgTypes = {
@ -691,6 +692,11 @@ const parseCondition = (obj, columnAliases, qb, pKey?) => {
case 'nin':
qb = qb.whereNotIn(fieldName, val);
break;
default:
NcError.metaError({
message: `Found invalid conditional operator "${key}" in expression`,
sql: '',
});
}
}
break;

Loading…
Cancel
Save