aboutsummaryrefslogtreecommitdiff
path: root/src/Web
diff options
context:
space:
mode:
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);