From fc923e7dad69018902647564d78cd3464718674a Mon Sep 17 00:00:00 2001 From: Wing-Kam Wong Date: Sat, 4 Mar 2023 18:48:26 +0800 Subject: [PATCH] refactor(nocodb): add getAjvValidatorMw in viewColumnApi.ts --- packages/nocodb/src/lib/meta/api/viewColumnApis.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/packages/nocodb/src/lib/meta/api/viewColumnApis.ts b/packages/nocodb/src/lib/meta/api/viewColumnApis.ts index 2fc4df7625..9da4a8c51d 100644 --- a/packages/nocodb/src/lib/meta/api/viewColumnApis.ts +++ b/packages/nocodb/src/lib/meta/api/viewColumnApis.ts @@ -3,6 +3,7 @@ import View from '../../models/View'; import { Tele } from 'nc-help'; import ncMetaAclMw from '../helpers/ncMetaAclMw'; import { metaApiMetrics } from '../helpers/apiMetrics'; +import { getAjvValidatorMw } from './helpers'; export async function columnList(req: Request, res: Response) { res.json(await View.getColumns(req.params.viewId)); @@ -40,11 +41,13 @@ router.get( router.post( '/api/v1/db/meta/views/:viewId/columns/', metaApiMetrics, + getAjvValidatorMw('swagger.json#/components/schemas/ViewColumnReq'), ncMetaAclMw(columnAdd, 'columnAdd') ); router.patch( '/api/v1/db/meta/views/:viewId/columns/:columnId', metaApiMetrics, + getAjvValidatorMw('swagger.json#/components/schemas/ViewColumnUpdateReq'), ncMetaAclMw(columnUpdate, 'viewColumnUpdate') ); export default router;