From b29b229e478e63f08e2e5c788fa30ef6ba8a126a Mon Sep 17 00:00:00 2001 From: Pranav C Date: Thu, 13 Apr 2023 23:47:23 +0530 Subject: [PATCH] fix: kanban update api handler correction Signed-off-by: Pranav C --- .../src/modules/kanbans/kanbans.controller.ts | 23 ++++++++++--------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/packages/nocodb-nest/src/modules/kanbans/kanbans.controller.ts b/packages/nocodb-nest/src/modules/kanbans/kanbans.controller.ts index da883a9e12..df6111ea37 100644 --- a/packages/nocodb-nest/src/modules/kanbans/kanbans.controller.ts +++ b/packages/nocodb-nest/src/modules/kanbans/kanbans.controller.ts @@ -1,15 +1,15 @@ import { Body, Controller, - Get, HttpCode, + Get, + HttpCode, Param, Patch, Post, UseGuards, -} from '@nestjs/common' +} from '@nestjs/common'; import { ViewCreateReqType } from 'nocodb-sdk'; -import { AuthGuard } from '@nestjs/passport'; -import { GlobalGuard } from '../../guards/global/global.guard' +import { GlobalGuard } from '../../guards/global/global.guard'; import { Acl, ExtractProjectIdMiddleware, @@ -44,12 +44,13 @@ export class KanbansController { @Patch('/api/v1/db/meta/kanbans/:kanbanViewId') @Acl('kanbanViewUpdate') - async kanbanViewUpdate(req, res) { - res.json( - await this.kanbansService.kanbanViewUpdate({ - kanbanViewId: req.params.kanbanViewId, - kanban: req.body, - }), - ); + async kanbanViewUpdate( + @Param('kanbanViewId') kanbanViewId: string, + @Body() body, + ) { + return await this.kanbansService.kanbanViewUpdate({ + kanbanViewId, + kanban: body, + }); } }