public IActionResult GetTrainingHours() { try { var decodedToken = authentication.DecodeTokenFromRequest(Request.Headers["Authorization"]); string role = authentication.GetRoleFromToken(decodedToken); int id = authentication.GetIDFromToken(decodedToken); if (role == "Club") { List <TrainingHours> thl = _clubLogic.GetTrainingHours(id); if (thl != null) { return(Ok(thl)); } else { return(StatusCode(404, "Resource not found")); } } return(StatusCode(500, "Failed")); } catch (Exception) { return(StatusCode(500, "Failed")); } }