From 17a0fc4f18680df4e32a0f93e3c134fcb82116ed Mon Sep 17 00:00:00 2001 From: Wing-Kam Wong Date: Mon, 27 Mar 2023 17:15:13 +0800 Subject: [PATCH] feat(nocodb): pass version to tableSampleData --- packages/nocodb/src/lib/controllers/hook.ctl.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/nocodb/src/lib/controllers/hook.ctl.ts b/packages/nocodb/src/lib/controllers/hook.ctl.ts index ae7b7ce112..fec5f4e62b 100644 --- a/packages/nocodb/src/lib/controllers/hook.ctl.ts +++ b/packages/nocodb/src/lib/controllers/hook.ctl.ts @@ -58,6 +58,7 @@ export async function tableSampleData(req: Request, res: Response) { await hookService.tableSampleData({ tableId: req.params.tableId, operation: req.params.operation as 'insert' | 'update', + version: req.params.version as 'v1' | 'v2', }) ); } @@ -102,7 +103,7 @@ router.patch( ncMetaAclMw(hookUpdate, 'hookUpdate') ); router.get( - '/api/v1/db/meta/tables/:tableId/hooks/samplePayload/:operation', + '/api/v1/db/meta/tables/:tableId/hooks/samplePayload/:operation/:version', metaApiMetrics, catchError(tableSampleData) );