From 35aa2574f8ebe8fe8f6d75e0edeef498b4aa8e3c Mon Sep 17 00:00:00 2001 From: Sven Heidemann Date: Sun, 17 Dec 2023 11:36:49 +0100 Subject: [PATCH] Fixed level order --- bot/src/bot_data/service/level_repository_service.py | 2 ++ bot/src/bot_graphql/queries/server_query.py | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/bot/src/bot_data/service/level_repository_service.py b/bot/src/bot_data/service/level_repository_service.py index 6897ddcc..7fa5e858 100644 --- a/bot/src/bot_data/service/level_repository_service.py +++ b/bot/src/bot_data/service/level_repository_service.py @@ -37,6 +37,8 @@ class LevelRepositoryService(LevelRepositoryABC): int(self._get_value_from_result(sql_result[3])), # min xp int(self._get_value_from_result(sql_result[4])), # permissions self._servers.get_server_by_id(sql_result[5]), # server + sql_result[6], # created_at + sql_result[7], # modified_at id=self._get_value_from_result(sql_result[0]), # id ) diff --git a/bot/src/bot_graphql/queries/server_query.py b/bot/src/bot_graphql/queries/server_query.py index 9b8b9cbf..33ccf9dc 100644 --- a/bot/src/bot_graphql/queries/server_query.py +++ b/bot/src/bot_graphql/queries/server_query.py @@ -77,7 +77,7 @@ class ServerQuery(DataQueryWithHistoryABC): ) self.add_collection( "level", - lambda server, *_: self._levels.get_levels_by_server_id(server.id), + lambda server, *_: self._levels.get_levels_by_server_id(server.id).order_by_descending(lambda x: x.min_xp), LevelFilter, ) self.set_field(