public IActionResult AddOpenPosition([FromBody] JobPosition entity) { var decodedToken = authentication.DecodeTokenFromRequest(Request.Headers["Authorization"]); string role = authentication.GetRoleFromToken(decodedToken); int id = authentication.GetIDFromToken(decodedToken); if (role == "Club") { if (_clubLogic.AddOpenPosition(entity, id)) { return(Ok()); } } return(StatusCode(500, "Failed")); }