aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/Web/DevHive.Web/Controllers/CommentController.cs1
-rw-r--r--src/Web/DevHive.Web/Controllers/RatingController.cs11
2 files changed, 11 insertions, 1 deletions
diff --git a/src/Web/DevHive.Web/Controllers/CommentController.cs b/src/Web/DevHive.Web/Controllers/CommentController.cs
index c38e300..7273dda 100644
--- a/src/Web/DevHive.Web/Controllers/CommentController.cs
+++ b/src/Web/DevHive.Web/Controllers/CommentController.cs
@@ -77,7 +77,6 @@ namespace DevHive.Web.Controllers
new OkResult() :
new BadRequestObjectResult("Could not delete Comment");
}
-
}
}
diff --git a/src/Web/DevHive.Web/Controllers/RatingController.cs b/src/Web/DevHive.Web/Controllers/RatingController.cs
index 33e6992..344acb2 100644
--- a/src/Web/DevHive.Web/Controllers/RatingController.cs
+++ b/src/Web/DevHive.Web/Controllers/RatingController.cs
@@ -71,5 +71,16 @@ namespace DevHive.Web.Controllers
return new OkObjectResult(readRatingWebModel);
}
}
+
+ [HttpDelete]
+ public async Task<IActionResult> DeleteTating(Guid id, [FromHeader] string authorization)
+ {
+ if (!await this._rateService.ValidateJwtForRating(id, authorization))
+ return new UnauthorizedResult();
+
+ return await this._rateService.DeleteRating(id) ?
+ new OkResult() :
+ new BadRequestObjectResult("Could not delete Rating");
+ }
}
}