end fase 2
This commit is contained in:
49
backend/src/team/roles.controller.ts
Normal file
49
backend/src/team/roles.controller.ts
Normal file
@ -0,0 +1,49 @@
|
||||
import {
|
||||
Controller,
|
||||
Get,
|
||||
Post,
|
||||
Patch,
|
||||
Delete,
|
||||
Body,
|
||||
Param,
|
||||
ParseUUIDPipe,
|
||||
HttpCode,
|
||||
HttpStatus,
|
||||
} from '@nestjs/common';
|
||||
import { RolesService } from './roles.service';
|
||||
import { CreateRoleDto } from './dto/create-role.dto';
|
||||
import { UpdateRoleDto } from './dto/update-role.dto';
|
||||
|
||||
@Controller('api/roles')
|
||||
export class RolesController {
|
||||
constructor(private readonly rolesService: RolesService) {}
|
||||
|
||||
@Get()
|
||||
findAll() {
|
||||
return this.rolesService.findAll();
|
||||
}
|
||||
|
||||
@Get(':id')
|
||||
findOne(@Param('id', ParseUUIDPipe) id: string) {
|
||||
return this.rolesService.findOne(id);
|
||||
}
|
||||
|
||||
@Post()
|
||||
create(@Body() createDto: CreateRoleDto) {
|
||||
return this.rolesService.create(createDto);
|
||||
}
|
||||
|
||||
@Patch(':id')
|
||||
update(
|
||||
@Param('id', ParseUUIDPipe) id: string,
|
||||
@Body() updateDto: UpdateRoleDto,
|
||||
) {
|
||||
return this.rolesService.update(id, updateDto);
|
||||
}
|
||||
|
||||
@Delete(':id')
|
||||
@HttpCode(HttpStatus.NO_CONTENT)
|
||||
remove(@Param('id', ParseUUIDPipe) id: string) {
|
||||
return this.rolesService.remove(id);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user