From 8743d117a153d881b5be085242752cb398a52186 Mon Sep 17 00:00:00 2001 From: Gustl22 Date: Tue, 2 Apr 2024 16:19:31 +0200 Subject: [PATCH] feat(server): Order team matches by date --- .../lib/controllers/league_controller.dart | 2 +- .../lib/controllers/team_controller.dart | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) 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(),