Website Summary Files Commits Branches @commit @diff @stats
path: root / src / DevHive.Web / Controllers / PostController.cs
diff options
context:
space:
mode:
Commit52c7f1f735e6846535dd58b08dc1ff8255a65a81 (patch)
Author
 Syndamia <kamen.d.mladenov@protonmail.com>
2021-01-28 21:34:08 +0200
Committer
 Syndamia <kamen.d.mladenov@protonmail.com>
2021-01-28 21:34:08 +0200
Files473c67e166a9df93d09a9e4d13e8085d62f80894 /src/DevHive.Web/Controllers/PostController.cs
DevHive-52c7f1f735e6846535dd58b08dc1ff8255a65a81.tar
DevHive-52c7f1f735e6846535dd58b08dc1ff8255a65a81.tar.gz
DevHive-52c7f1f735e6846535dd58b08dc1ff8255a65a81.zip
Parentc450d08b0bb15bd050695ee599e286815958def0 (diff)
Fixed create post and comment validation logic
1 files changed, 2 insertions, 2 deletions
-rw-r--r--src/DevHive.Web/Controllers/PostController.cs4
diff --git a/src/DevHive.Web/Controllers/PostController.cs b/src/DevHive.Web/Controllers/PostController.cs
index 0ca041f..fe71519 100644
--- a/src/DevHive.Web/Controllers/PostController.cs
+++ b/src/DevHive.Web/Controllers/PostController.cs
@@ -29,7 +29,7 @@ namespace DevHive.Web.Controllers
[HttpPost]
public async Task<IActionResult> Create(Guid userId, [FromBody] CreatePostWebModel createPostWebModel, [FromHeader] string authorization)
{
- if (await this._postService.ValidateJwtForCreating(userId, authorization))
+ if (!await this._postService.ValidateJwtForCreating(userId, authorization))
return new UnauthorizedResult();
CreatePostServiceModel createPostServiceModel =
@@ -47,7 +47,7 @@ namespace DevHive.Web.Controllers
[Route("Comment")]
public async Task<IActionResult> AddComment(Guid userId, [FromBody] CreateCommentWebModel createCommentWebModel, [FromHeader] string authorization)
{
- if (await this._postService.ValidateJwtForCreating(userId, authorization))
+ if (!await this._postService.ValidateJwtForCreating(userId, authorization))
return new UnauthorizedResult();
CreateCommentServiceModel createCommentServiceModel =