feat(contents): add updateAdmin endpoint and repository method

- Introduced `PATCH /:id/admin` endpoint to update admin-specific content.
- Added `update` method to `ContentsRepository` for data updates with timestamp.
This commit is contained in:
Mathis HERRIOT
2026-01-21 13:18:41 +01:00
parent 02796e4e1f
commit 07cdb741b3
2 changed files with 17 additions and 0 deletions

View File

@@ -10,6 +10,7 @@ import {
Param,
ParseBoolPipe,
ParseIntPipe,
Patch,
Post,
Query,
Req,
@@ -185,4 +186,11 @@ export class ContentsController {
removeAdmin(@Param("id") id: string) {
return this.contentsService.removeAdmin(id);
}
@Patch(":id/admin")
@UseGuards(AuthGuard, RolesGuard)
@Roles("admin")
updateAdmin(@Param("id") id: string, @Body() updateContentDto: any) {
return this.contentsService.updateAdmin(id, updateContentDto);
}
}