From 10cc5a6d8d1b9823e5f6b588eda64b9a5bcca967 Mon Sep 17 00:00:00 2001 From: Mathis HERRIOT <197931332+0x485254@users.noreply.github.com> Date: Wed, 21 Jan 2026 13:42:24 +0100 Subject: [PATCH] feat(contents): add `update` endpoint to contents controller - Introduced a `PATCH /:id` endpoint to enable partial content updates. - Integrated AuthGuard for securing the endpoint. --- backend/src/contents/contents.controller.ts | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/backend/src/contents/contents.controller.ts b/backend/src/contents/contents.controller.ts index 5b66270..a8a4bda 100644 --- a/backend/src/contents/contents.controller.ts +++ b/backend/src/contents/contents.controller.ts @@ -174,6 +174,16 @@ export class ContentsController { return this.contentsService.incrementUsage(id); } + @Patch(":id") + @UseGuards(AuthGuard) + update( + @Param("id") id: string, + @Req() req: AuthenticatedRequest, + @Body() updateContentDto: any, + ) { + return this.contentsService.update(id, req.user.sub, updateContentDto); + } + @Delete(":id") @UseGuards(AuthGuard) remove(@Param("id") id: string, @Req() req: AuthenticatedRequest) {