public async Task <IActionResult> GenerateSchedule(int leagueId) { var result = await _leagueService.GenerateMatchSchedule(leagueId); if (result.ErrorOccurred) { return(BadRequest(result)); } return(Ok(result)); }