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