mirror of
https://github.com/PeterMaquiran/tvone-api.git
synced 2026-04-22 03:55:50 +00:00
This commit is contained in:
@@ -22,33 +22,33 @@ import { UpdateCategoryDto } from './dto/update-category.dto';
|
||||
export class CategoriesController {
|
||||
constructor(private readonly categoriesService: CategoriesService) {}
|
||||
|
||||
@UseGuards(AuthGuard('keycloak'), UserProvisioningGuard, RolesGuard)
|
||||
@UseGuards(AuthGuard('keycloak'))
|
||||
@Get()
|
||||
tree() {
|
||||
return this.categoriesService.tree();
|
||||
}
|
||||
|
||||
@UseGuards(AuthGuard('keycloak'), UserProvisioningGuard, RolesGuard)
|
||||
@UseGuards(AuthGuard('keycloak'))
|
||||
@Get('flat')
|
||||
flat() {
|
||||
return this.categoriesService.findAllFlat();
|
||||
}
|
||||
|
||||
@UseGuards(AuthGuard('keycloak'), UserProvisioningGuard, RolesGuard)
|
||||
@UseGuards(AuthGuard('keycloak'))
|
||||
//@Roles(UserRole.ADMIN, UserRole.EDITOR)
|
||||
@Post()
|
||||
create(@Body() dto: CreateCategoryDto) {
|
||||
return this.categoriesService.create(dto);
|
||||
}
|
||||
|
||||
@UseGuards(AuthGuard('keycloak'), UserProvisioningGuard, RolesGuard)
|
||||
@UseGuards(AuthGuard('keycloak'))
|
||||
//@Roles(UserRole.ADMIN, UserRole.EDITOR)
|
||||
@Patch(':id')
|
||||
update(@Param('id', ParseUUIDPipe) id: string, @Body() dto: UpdateCategoryDto) {
|
||||
return this.categoriesService.update(id, dto);
|
||||
}
|
||||
|
||||
@UseGuards(AuthGuard('keycloak'), UserProvisioningGuard, RolesGuard)
|
||||
@UseGuards(AuthGuard('keycloak'))
|
||||
//@Roles(UserRole.ADMIN, UserRole.EDITOR)
|
||||
@Delete(':id')
|
||||
remove(@Param('id', ParseUUIDPipe) id: string) {
|
||||
|
||||
Reference in New Issue
Block a user