diff --git a/src/game/game.service.ts b/src/game/game.service.ts index 1bad6aed11bc8a3512a711238599e46234e7b89c..9a74a46d8506ccc4a1d03dc6873ba86d74758bb6 100644 --- a/src/game/game.service.ts +++ b/src/game/game.service.ts @@ -132,6 +132,10 @@ export class GameService { where: { id: id }, relations: ['factions', 'objective_points'], }); + // sort factions by their name + game.factions.sort(function(a, b) { + return a['factionName'].localeCompare(b['factionName']); + }); return game; }