modulo endpoints restringidos a usuario
This commit is contained in:
@@ -28,20 +28,6 @@ import { MarcaOutputDto } from './dto/output/marca.dto';
|
||||
export class MarcaController {
|
||||
constructor(private marcaService: MarcaService) {}
|
||||
|
||||
@Serealize(MarcaOutputDto)
|
||||
@Get()
|
||||
@UseGuards(AuthGuard('jwt'))
|
||||
@ApiOperation({ description: 'Endpoint que retorna todass las marcas.' })
|
||||
@ApiBearerAuth('jwt')
|
||||
@ApiQuery({
|
||||
description: 'Tipo de marca que se busca.',
|
||||
name: 'tipo',
|
||||
type: 'text',
|
||||
})
|
||||
get(@Query() query: MarcaDto) {
|
||||
return this.marcaService.findAll(query.tipo);
|
||||
}
|
||||
|
||||
@Post()
|
||||
@UseGuards(AuthGuard('jwt'))
|
||||
@ApiOperation({ description: 'Endpoint que crea una nueva marca.' })
|
||||
@@ -59,4 +45,18 @@ export class MarcaController {
|
||||
);
|
||||
return this.marcaService.create(body.marca, body.tipo);
|
||||
}
|
||||
|
||||
@Serealize(MarcaOutputDto)
|
||||
@Get()
|
||||
@UseGuards(AuthGuard('jwt'))
|
||||
@ApiOperation({ description: 'Endpoint que retorna todass las marcas.' })
|
||||
@ApiBearerAuth('jwt')
|
||||
@ApiQuery({
|
||||
description: 'Tipo de marca que se busca.',
|
||||
name: 'tipo',
|
||||
type: 'text',
|
||||
})
|
||||
get(@Query() query: MarcaDto) {
|
||||
return this.marcaService.findAll(query.tipo);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user