public IActionResult saveGrade(int participationId, [FromBody] SavedGradeDTO grade) { var claimsIdentity = this.User.Identity as ClaimsIdentity; try { if (!appSettingsService.canGrade()) { throw new AppException("Akcja obecnie niedozwolona"); } userService.IsUserAnJudge(claimsIdentity); contestService.saveGrade(grade); return(Ok()); } catch (Exception e) { return(BadRequest(new { message = e.Message })); } }