Skip to content

Commit

Permalink
feat(server): Order team matches by date
Browse files Browse the repository at this point in the history
  • Loading branch information
Gustl22 committed Apr 2, 2024
1 parent e5d12c0 commit 8743d11
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,6 @@ class LeagueController extends EntityController<League> {

Future<Response> 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']);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ class TeamController extends EntityController<Team> {
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<Response> requestTeamMatches(Request request, String id) async {
return EntityController.handleRequestManyOfControllerFromQuery(TeamMatchController(),
Expand Down

0 comments on commit 8743d11

Please sign in to comment.