Update Submodules
This commit is contained in:
@@ -1,9 +1,10 @@
|
||||
import { Controller, Get, Inject, Param } from '@nestjs/common';
|
||||
import { Body, Controller, Get, Inject, Param, Post } from '@nestjs/common';
|
||||
import { FormularService } from './formular.service';
|
||||
import { Query } from '@nestjs/graphql';
|
||||
import { Formular, MyField } from 'src/dto/formular.dto';
|
||||
import { FormularEntity } from './formular.entity';
|
||||
import { FieldEntity } from './fields.entity';
|
||||
import { ApiBody } from '@nestjs/swagger';
|
||||
|
||||
@Controller('/api/formulare')
|
||||
export class FormularController {
|
||||
@@ -27,12 +28,23 @@ export class FormularController {
|
||||
return await this.formularService.getFields(formularid);
|
||||
}
|
||||
|
||||
@Get("/submit/:formularid")
|
||||
@Post("/submit/:formularid")
|
||||
@ApiBody({
|
||||
schema: {
|
||||
type: 'object',
|
||||
additionalProperties: {
|
||||
type: 'string',
|
||||
},
|
||||
},
|
||||
})
|
||||
async submit(
|
||||
@Param("formularid")
|
||||
formularid:number
|
||||
){
|
||||
return await this.formularService.submit(formularid);
|
||||
formularid:number,
|
||||
|
||||
@Body()
|
||||
body:any
|
||||
): Promise<boolean>{
|
||||
return await this.formularService.submit(<number>formularid,Object.keys(body),Object.values(body));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user