From 7bc94804e3222521297c2d86fd2a145b6de161a6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn-Michael=20Miehe?= Date: Thu, 21 Sep 2023 00:45:57 +0000 Subject: [PATCH] remove DayStrModel --- api/advent22_api/routers/admin.py | 15 ++++-------- ui/src/components/admin/CalendarAssistant.vue | 24 +++++++++---------- ui/src/components/admin/ConfigView.vue | 16 ++++++------- ui/src/lib/api.ts | 5 ++-- ui/src/plugins/advent22.ts | 2 +- 5 files changed, 26 insertions(+), 36 deletions(-) diff --git a/api/advent22_api/routers/admin.py b/api/advent22_api/routers/admin.py index 7104f03..478cd74 100644 --- a/api/advent22_api/routers/admin.py +++ b/api/advent22_api/routers/admin.py @@ -93,35 +93,28 @@ async def get_config_model( ) -class DayStrModel(BaseModel): - day: int - value: str - - @router.get("/day_parts") async def get_day_parts( _: None = Depends(require_admin), parts: dict[int, str] = Depends(get_all_parts), -) -> list[DayStrModel]: +) -> dict[int, str]: """ Zuordnung der Lösungsteile zu den Tagen """ - return [DayStrModel(day=day, value=part) for day, part in sorted(parts.items())] + return parts @router.get("/day_image_names") async def get_day_image_names( _: None = Depends(require_admin), image_names: dict[int, str] = Depends(get_all_image_names), -) -> list[DayStrModel]: +) -> dict[int, str]: """ Zuordnung der verwendeten Bilder zu den Tagen """ - return [ - DayStrModel(day=day, value=name) for day, name in sorted(image_names.items()) - ] + return image_names @router.get("/doors") diff --git a/ui/src/components/admin/CalendarAssistant.vue b/ui/src/components/admin/CalendarAssistant.vue index b053bb9..d599b1b 100644 --- a/ui/src/components/admin/CalendarAssistant.vue +++ b/ui/src/components/admin/CalendarAssistant.vue @@ -46,7 +46,7 @@