aboutsummaryrefslogtreecommitdiff
path: root/src/Web/DevHive.Web/Controllers/RatingController.cs
diff options
context:
space:
mode:
Diffstat (limited to 'src/Web/DevHive.Web/Controllers/RatingController.cs')
-rw-r--r--src/Web/DevHive.Web/Controllers/RatingController.cs11
1 files changed, 11 insertions, 0 deletions
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");
+ }
}
}