diff options
| author | transtrike <transtrike@gmail.com> | 2021-01-31 13:38:15 +0200 |
|---|---|---|
| committer | transtrike <transtrike@gmail.com> | 2021-01-31 13:38:15 +0200 |
| commit | 5a8c7d92216bb7fafc649056a00c11682b82a279 (patch) | |
| tree | c6b308f1b971b46f4ca750108a1371bb7cd13b5c /src/DevHive.Web/Controllers/CommentController.cs | |
| parent | 505bc41720cbcd02d65e17a6440931c87abcdeda (diff) | |
| download | DevHive-5a8c7d92216bb7fafc649056a00c11682b82a279.tar DevHive-5a8c7d92216bb7fafc649056a00c11682b82a279.tar.gz DevHive-5a8c7d92216bb7fafc649056a00c11682b82a279.zip | |
Fixed NullReference in cloud, CommentEditingWebModel, PromotionToAdmin, Posts violate key in db
Diffstat (limited to 'src/DevHive.Web/Controllers/CommentController.cs')
| -rw-r--r-- | src/DevHive.Web/Controllers/CommentController.cs | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/DevHive.Web/Controllers/CommentController.cs b/src/DevHive.Web/Controllers/CommentController.cs index ebcb87a..150d622 100644 --- a/src/DevHive.Web/Controllers/CommentController.cs +++ b/src/DevHive.Web/Controllers/CommentController.cs @@ -9,10 +9,11 @@ using DevHive.Services.Interfaces; namespace DevHive.Web.Controllers { - [ApiController] + [ApiController] [Route("/api/[controller]")] [Authorize(Roles = "User,Admin")] - public class CommentController { + public class CommentController + { private readonly ICommentService _commentService; private readonly IMapper _commentMapper; @@ -50,9 +51,9 @@ namespace DevHive.Web.Controllers } [HttpPut] - public async Task<IActionResult> UpdateComment(Guid userId, [FromBody] UpdateCommentWebModel updateCommentWebModel, [FromHeader] string authorization) + public async Task<IActionResult> UpdateComment(Guid userId, Guid commentId, [FromBody] UpdateCommentWebModel updateCommentWebModel, [FromHeader] string authorization) { - if (!await this._commentService.ValidateJwtForComment(updateCommentWebModel.CommentId, authorization)) + if (!await this._commentService.ValidateJwtForComment(commentId, authorization)) return new UnauthorizedResult(); UpdateCommentServiceModel updateCommentServiceModel = |
