feat(contents): add update endpoint to contents controller
- Introduced a `PATCH /:id` endpoint to enable partial content updates. - Integrated AuthGuard for securing the endpoint.
This commit is contained in:
@@ -174,6 +174,16 @@ export class ContentsController {
|
|||||||
return this.contentsService.incrementUsage(id);
|
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")
|
@Delete(":id")
|
||||||
@UseGuards(AuthGuard)
|
@UseGuards(AuthGuard)
|
||||||
remove(@Param("id") id: string, @Req() req: AuthenticatedRequest) {
|
remove(@Param("id") id: string, @Req() req: AuthenticatedRequest) {
|
||||||
|
|||||||
Reference in New Issue
Block a user