diff --git a/wrestling_scoreboard_server/lib/controllers/league_controller.dart b/wrestling_scoreboard_server/lib/controllers/league_controller.dart index 054815c4..f9a72c8d 100644 --- a/wrestling_scoreboard_server/lib/controllers/league_controller.dart +++ b/wrestling_scoreboard_server/lib/controllers/league_controller.dart @@ -26,6 +26,6 @@ class LeagueController extends EntityController { Future requestTeamMatchs(Request request, String id) async { return EntityController.handleRequestManyOfController(TeamMatchController(), - isRaw: isRaw(request), conditions: ['league_id = @id'], substitutionValues: {'id': id}); + isRaw: isRaw(request), conditions: ['league_id = @id'], substitutionValues: {'id': id}, orderBy: ['date']); } } diff --git a/wrestling_scoreboard_server/lib/controllers/team_controller.dart b/wrestling_scoreboard_server/lib/controllers/team_controller.dart index f13b1d0d..0d37716d 100644 --- a/wrestling_scoreboard_server/lib/controllers/team_controller.dart +++ b/wrestling_scoreboard_server/lib/controllers/team_controller.dart @@ -17,7 +17,8 @@ class TeamController extends EntityController { SELECT tm.* FROM team_match AS tm JOIN lineup AS lu ON tm.home_id = lu.id OR tm.guest_id = lu.id - WHERE lu.team_id = @id;'''; + WHERE lu.team_id = @id + ORDER BY date;'''; Future requestTeamMatches(Request request, String id) async { return EntityController.handleRequestManyOfControllerFromQuery(TeamMatchController(),