Browse Source

refactor(nocodb): add getAjvValidatorMw in viewColumnApi.ts

pull/5222/head
Wing-Kam Wong 2 years ago
parent
commit
fc923e7dad
  1. 3
      packages/nocodb/src/lib/meta/api/viewColumnApis.ts

3
packages/nocodb/src/lib/meta/api/viewColumnApis.ts

@ -3,6 +3,7 @@ import View from '../../models/View';
import { Tele } from 'nc-help'; import { Tele } from 'nc-help';
import ncMetaAclMw from '../helpers/ncMetaAclMw'; import ncMetaAclMw from '../helpers/ncMetaAclMw';
import { metaApiMetrics } from '../helpers/apiMetrics'; import { metaApiMetrics } from '../helpers/apiMetrics';
import { getAjvValidatorMw } from './helpers';
export async function columnList(req: Request, res: Response) { export async function columnList(req: Request, res: Response) {
res.json(await View.getColumns(req.params.viewId)); res.json(await View.getColumns(req.params.viewId));
@ -40,11 +41,13 @@ router.get(
router.post( router.post(
'/api/v1/db/meta/views/:viewId/columns/', '/api/v1/db/meta/views/:viewId/columns/',
metaApiMetrics, metaApiMetrics,
getAjvValidatorMw('swagger.json#/components/schemas/ViewColumnReq'),
ncMetaAclMw(columnAdd, 'columnAdd') ncMetaAclMw(columnAdd, 'columnAdd')
); );
router.patch( router.patch(
'/api/v1/db/meta/views/:viewId/columns/:columnId', '/api/v1/db/meta/views/:viewId/columns/:columnId',
metaApiMetrics, metaApiMetrics,
getAjvValidatorMw('swagger.json#/components/schemas/ViewColumnUpdateReq'),
ncMetaAclMw(columnUpdate, 'viewColumnUpdate') ncMetaAclMw(columnUpdate, 'viewColumnUpdate')
); );
export default router; export default router;

Loading…
Cancel
Save