Website Summary Files Commits Branches @commit @diff @stats
path: root / src / DevHive.Web / Controllers / CommentController.cs
diff options
context:
space:
mode:
Commit8178c3ca862fee815720cca760524b462a01704d (patch)
Author
 Syndamia <kamen.d.mladenov@protonmail.com>
2021-02-02 10:38:58 +0200
Committer
 Syndamia <kamen.d.mladenov@protonmail.com>
2021-02-02 10:38:58 +0200
Files0ca7c4295e191c698c4d5cd83cee6342ea4c22f2 /src/DevHive.Web/Controllers/CommentController.cs
DevHive-8178c3ca862fee815720cca760524b462a01704d.tar
DevHive-8178c3ca862fee815720cca760524b462a01704d.tar.gz
DevHive-8178c3ca862fee815720cca760524b462a01704d.zip
Parent482f16d7acc82e1f5720a95af18e1d713546bd4b (diff)
Fixed update comment web model and update method
1 files changed, 2 insertions, 3 deletions
-rw-r--r--src/DevHive.Web/Controllers/CommentController.cs5
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<IActionResult> UpdateComment(Guid userId, Guid commentId, [FromBody] UpdateCommentWebModel updateCommentWebModel, [FromHeader] string authorization)
+ public async Task<IActionResult> 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<UpdateCommentServiceModel>(updateCommentWebModel);
updateCommentServiceModel.CreatorId = userId;
- updateCommentServiceModel.CommentId = commentId;
Guid id = await this._commentService.UpdateComment(updateCommentServiceModel);