aboutsummaryrefslogtreecommitdiff
path: root/src/Web
diff options
context:
space:
mode:
authorDanail Dimitrov <danaildimitrov321@gmail.com>2021-03-03 10:27:26 +0200
committerDanail Dimitrov <danaildimitrov321@gmail.com>2021-03-03 10:27:26 +0200
commitf986ca67edd425c32eaec5a20fecdc5786f9d8e3 (patch)
tree1d63feb6622257735a4a5e878ba9e7fd1cafbfc7 /src/Web
parent804d274223734ea1c67920622ceb453cca602fc9 (diff)
downloadDevHive-f986ca67edd425c32eaec5a20fecdc5786f9d8e3.tar
DevHive-f986ca67edd425c32eaec5a20fecdc5786f9d8e3.tar.gz
DevHive-f986ca67edd425c32eaec5a20fecdc5786f9d8e3.zip
Fixing bugs in rating layer
Diffstat (limited to 'src/Web')
-rw-r--r--src/Web/DevHive.Web.Models/Rating/UpdateRatingWebModel.cs4
-rw-r--r--src/Web/DevHive.Web/Controllers/RatingController.cs3
2 files changed, 2 insertions, 5 deletions
diff --git a/src/Web/DevHive.Web.Models/Rating/UpdateRatingWebModel.cs b/src/Web/DevHive.Web.Models/Rating/UpdateRatingWebModel.cs
index 425c3e1..176c099 100644
--- a/src/Web/DevHive.Web.Models/Rating/UpdateRatingWebModel.cs
+++ b/src/Web/DevHive.Web.Models/Rating/UpdateRatingWebModel.cs
@@ -8,10 +8,6 @@ namespace DevHive.Web.Models.Rating
{
public class UpdateRatingWebModel
{
- public Guid Id { get; set; }
-
- public Guid PostId { get; set; }
-
public bool IsLike { get; set; }
}
}
diff --git a/src/Web/DevHive.Web/Controllers/RatingController.cs b/src/Web/DevHive.Web/Controllers/RatingController.cs
index 5716b85..8d3ac92 100644
--- a/src/Web/DevHive.Web/Controllers/RatingController.cs
+++ b/src/Web/DevHive.Web/Controllers/RatingController.cs
@@ -65,7 +65,7 @@ namespace DevHive.Web.Controllers
}
[HttpPut]
- public async Task<IActionResult> UpdateRating(Guid userId, [FromBody] UpdateRatingWebModel updateRatingWebModel, [FromHeader] string authorization)
+ public async Task<IActionResult> UpdateRating(Guid userId, Guid postId, [FromBody] UpdateRatingWebModel updateRatingWebModel, [FromHeader] string authorization)
{
if (!this._jwtService.ValidateToken(userId, authorization))
return new UnauthorizedResult();
@@ -73,6 +73,7 @@ namespace DevHive.Web.Controllers
UpdateRatingServiceModel updateRatingServiceModel =
this._mapper.Map<UpdateRatingServiceModel>(updateRatingWebModel);
updateRatingServiceModel.UserId = userId;
+ updateRatingServiceModel.PostId = postId;
ReadRatingServiceModel readRatingServiceModel = await this._rateService.UpdateRating(updateRatingServiceModel);