aboutsummaryrefslogtreecommitdiff
path: root/src/DevHive.Web
diff options
context:
space:
mode:
Diffstat (limited to 'src/DevHive.Web')
-rw-r--r--src/DevHive.Web/Controllers/CommentController.cs5
-rw-r--r--src/DevHive.Web/Models/Comment/UpdateCommentWebModel.cs2
2 files changed, 4 insertions, 3 deletions
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);
diff --git a/src/DevHive.Web/Models/Comment/UpdateCommentWebModel.cs b/src/DevHive.Web/Models/Comment/UpdateCommentWebModel.cs
index 1e120fd..b5d7970 100644
--- a/src/DevHive.Web/Models/Comment/UpdateCommentWebModel.cs
+++ b/src/DevHive.Web/Models/Comment/UpdateCommentWebModel.cs
@@ -4,6 +4,8 @@ namespace DevHive.Web.Models.Comment
{
public class UpdateCommentWebModel
{
+ public Guid CommentId { get; set; }
+
public Guid PostId { get; set; }
public string NewMessage { get; set; }