public async Task <IActionResult> Acknowledge([FromBody] TeamCommentReportModel model, int?id = null) { var teamCommentId = id ?? model.TeamCommentId; var team = DbContext.TeamComments.SingleOrDefault(x => x.Id == teamCommentId); if (team != null) { team.Reported = false; await DbContext.SaveChangesSafe(); } return(Ok(teamCommentId)); }
public async Task <IActionResult> Report([FromBody] TeamCommentReportModel model, int?id = null) { if (Throttled && !ThrottlingService.CanAccess(User, Request)) { return(StatusCode(429, ThrottleService.Message)); } var teamCommentId = id ?? model.TeamCommentId; var team = DbContext.TeamComments.SingleOrDefault(x => x.Id == teamCommentId); if (team != null) { team.Reported = true; await DbContext.SaveChangesSafe(); } return(Ok(teamCommentId)); }