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 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;

Loading…
Cancel
Save