Browse Source

fix(nocodb): make sure fk_column_id is present for filter insert

pull/4795/head
Wing-Kam Wong 2 years ago
parent
commit
da768806a2
  1. 4
      packages/nocodb/src/lib/models/Filter.ts

4
packages/nocodb/src/lib/models/Filter.ts

@ -10,6 +10,7 @@ import {
import View from './View'; import View from './View';
import { FilterType, UITypes } from 'nocodb-sdk'; import { FilterType, UITypes } from 'nocodb-sdk';
import NocoCache from '../cache/NocoCache'; import NocoCache from '../cache/NocoCache';
import { NcError } from '../meta/helpers/catchError';
export default class Filter { export default class Filter {
id: string; id: string;
@ -69,6 +70,9 @@ export default class Filter {
filter: Partial<FilterType>, filter: Partial<FilterType>,
ncMeta = Noco.ncMeta ncMeta = Noco.ncMeta
) { ) {
if (!filter.fk_column_id) {
NcError.badRequest('fk_column_id is required');
}
const insertObj = { const insertObj = {
id: filter.id, id: filter.id,
fk_view_id: filter.fk_view_id, fk_view_id: filter.fk_view_id,

Loading…
Cancel
Save