|
|
@ -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, |
|
|
@ -17,7 +17,7 @@ import { |
|
|
|
import { FormsService } from './forms.service'; |
|
|
|
import { FormsService } from './forms.service'; |
|
|
|
|
|
|
|
|
|
|
|
@Controller() |
|
|
|
@Controller() |
|
|
|
@UseGuards(ExtractProjectIdMiddleware,GlobalGuard) |
|
|
|
@UseGuards(ExtractProjectIdMiddleware, GlobalGuard) |
|
|
|
export class FormsController { |
|
|
|
export class FormsController { |
|
|
|
constructor(private readonly formsService: FormsService) {} |
|
|
|
constructor(private readonly formsService: FormsService) {} |
|
|
|
|
|
|
|
|
|
|
@ -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, |
|
|
|
}); |
|
|
|
}), |
|
|
|
|
|
|
|
); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|