From 8178c3ca862fee815720cca760524b462a01704d Mon Sep 17 00:00:00 2001 From: Syndamia Date: Tue, 2 Feb 2021 10:38:58 +0200 Subject: Fixed update comment web model and update method --- src/DevHive.Web/Controllers/CommentController.cs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'src/DevHive.Web/Controllers/CommentController.cs') diff --git a/src/DevHive.Web/Controllers/CommentController.cs b/src/DevHive.Web/Controllers/CommentController.cs index 9c3eeee..c38e300 100644 --- a/src/DevHive.Web/Controllers/CommentController.cs +++ b/src/DevHive.Web/Controllers/CommentController.cs @@ -51,15 +51,14 @@ namespace DevHive.Web.Controllers } [HttpPut] - public async Task UpdateComment(Guid userId, Guid commentId, [FromBody] UpdateCommentWebModel updateCommentWebModel, [FromHeader] string authorization) + public async Task UpdateComment(Guid userId, [FromBody] UpdateCommentWebModel updateCommentWebModel, [FromHeader] string authorization) { - if (!await this._commentService.ValidateJwtForComment(commentId, authorization)) + if (!await this._commentService.ValidateJwtForComment(updateCommentWebModel.CommentId, authorization)) return new UnauthorizedResult(); UpdateCommentServiceModel updateCommentServiceModel = this._commentMapper.Map(updateCommentWebModel); updateCommentServiceModel.CreatorId = userId; - updateCommentServiceModel.CommentId = commentId; Guid id = await this._commentService.UpdateComment(updateCommentServiceModel); -- cgit v1.2.3