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