tipo usuario documentación
This commit is contained in:
parent
c194e7d252
commit
7fe8f772c5
@ -1,19 +1,27 @@
|
|||||||
import { Body, Controller, Get, Post } from '@nestjs/common';
|
import { Body, Controller, Get, Post } from '@nestjs/common';
|
||||||
|
import { ApiBody, ApiOperation, ApiTags } from '@nestjs/swagger';
|
||||||
import { TipoUsuarioService } from './tipo-usuario.service';
|
import { TipoUsuarioService } from './tipo-usuario.service';
|
||||||
import { TipoUsuarioUpdateDto } from './dto/tipo-usuario-update.dto';
|
import { TipoUsuarioUpdateDto } from './dto/tipo-usuario-update.dto';
|
||||||
import {ApiTags} from '@nestjs/swagger'
|
|
||||||
|
|
||||||
@Controller('tipo-usuario')
|
@Controller('tipo-usuario')
|
||||||
// @ApiTags('tipo-usuario')
|
@ApiTags('tipo-usuario')
|
||||||
export class TipoUsuarioController {
|
export class TipoUsuarioController {
|
||||||
constructor(private tipoUsuarioService: TipoUsuarioService) {}
|
constructor(private tipoUsuarioService: TipoUsuarioService) {}
|
||||||
|
|
||||||
@Post()
|
@Post()
|
||||||
|
@ApiOperation({ description: 'Endpoint que crea un nuevo tipo de usuario.' })
|
||||||
|
@ApiBody({
|
||||||
|
description: 'Es obligatoria mandar el campo tipo_usuario.',
|
||||||
|
examples: { ejemplo: { value: { tipo_usuario: '' } } },
|
||||||
|
})
|
||||||
create(@Body() body: TipoUsuarioUpdateDto) {
|
create(@Body() body: TipoUsuarioUpdateDto) {
|
||||||
return this.tipoUsuarioService.create(body.tipo_usuario);
|
return this.tipoUsuarioService.create(body.tipo_usuario);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Get()
|
@Get()
|
||||||
|
@ApiOperation({
|
||||||
|
description: 'Endpoint que retorna todos los tipos de usuario.',
|
||||||
|
})
|
||||||
get() {
|
get() {
|
||||||
return this.tipoUsuarioService.findAll();
|
return this.tipoUsuarioService.findAll();
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user