From da768806a28bba3cdcfb6b258ff1644882f6411d Mon Sep 17 00:00:00 2001 From: Wing-Kam Wong Date: Tue, 10 Jan 2023 18:48:02 +0800 Subject: [PATCH] fix(nocodb): make sure fk_column_id is present for filter insert --- packages/nocodb/src/lib/models/Filter.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/packages/nocodb/src/lib/models/Filter.ts b/packages/nocodb/src/lib/models/Filter.ts index 34ff8a2f50..42838aa22d 100644 --- a/packages/nocodb/src/lib/models/Filter.ts +++ b/packages/nocodb/src/lib/models/Filter.ts @@ -10,6 +10,7 @@ import { import View from './View'; import { FilterType, UITypes } from 'nocodb-sdk'; import NocoCache from '../cache/NocoCache'; +import { NcError } from '../meta/helpers/catchError'; export default class Filter { id: string; @@ -69,6 +70,9 @@ export default class Filter { filter: Partial, ncMeta = Noco.ncMeta ) { + if (!filter.fk_column_id) { + NcError.badRequest('fk_column_id is required'); + } const insertObj = { id: filter.id, fk_view_id: filter.fk_view_id,