Browse Source

fix: form update api handler correction

Signed-off-by: Pranav C <pranavxc@gmail.com>
pull/5444/head
Pranav C 2 years ago
parent
commit
458a4799b5
  1. 20
      packages/nocodb-nest/src/modules/forms/forms.controller.ts

20
packages/nocodb-nest/src/modules/forms/forms.controller.ts

@ -1,15 +1,15 @@
import { import {
Body, Body,
Controller, Controller,
Get, HttpCode, Get,
HttpCode,
Param, Param,
Patch, Patch,
Post, Post,
UseGuards, UseGuards,
} from '@nestjs/common' } from '@nestjs/common';
import { ViewCreateReqType } from 'nocodb-sdk'; 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 { import {
Acl, Acl,
ExtractProjectIdMiddleware, ExtractProjectIdMiddleware,
@ -45,12 +45,10 @@ export class FormsController {
} }
@Patch('/api/v1/db/meta/forms/:formViewId') @Patch('/api/v1/db/meta/forms/:formViewId')
@Acl('formViewUpdate') @Acl('formViewUpdate')
async formViewUpdate(req, res) { async formViewUpdate(@Param('formViewId') formViewId: string, @Body() body) {
res.json( return await this.formsService.formViewUpdate({
await this.formsService.formViewUpdate({ formViewId,
formViewId: req.params.formViewId, form: body,
form: req.body, });
}),
);
} }
} }

Loading…
Cancel
Save