From 326016be2a8fa6ed9949c495b552335ad3583f76 Mon Sep 17 00:00:00 2001 From: DmitryGantimurov Date: Sun, 13 Aug 2023 17:36:03 +0300 Subject: [PATCH] api/trashbox fixed --- back/api.py | 14 +++++++------- back/schemas.py | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/back/api.py b/back/api.py index ca077c7..6cf0d11 100644 --- a/back/api.py +++ b/back/api.py @@ -214,19 +214,19 @@ def get_trashboxes(data: schemas.TrashboxRequest = Depends()):#крутая фу match data.Category: case "PORRIDGE": list_of_category = ["Опасные отходы", "Иное"] - case "Конспекты": + case "conspects": list_of_category = ["Бумага"] - case "Молочные продукты": + case "milk": list_of_category = ["Стекло", "Тетра Пак", "Иное"] - case "Хлебобулочные изделия": + case "bred": list_of_category = ["Пластик", "Иное"] - case "Моющие средства": + case "wathing": list_of_category = ["Пластик", "Опасные отходы", "Иное"] - case "Одежда": + case "cloth": list_of_category = ["Одежда"] - case "Фрукты и овощи": + case "fruits_vegatables": list_of_category = ["Иное"] - case "Всякая всячина": + case "other_things": list_of_category = ["Металл", "Бумага", "Стекло", "Иное", "Тетра Пак", "Батарейки", "Крышечки", "Шины", "Опасные отходы", "Лампочки", "Пластик"] # Получение ответа от стороннего апи diff --git a/back/schemas.py b/back/schemas.py index 80cc7e0..82bfc2f 100644 --- a/back/schemas.py +++ b/back/schemas.py @@ -74,7 +74,7 @@ class TrashboxBase(BaseModel): class TrashboxResponse(TrashboxBase): Name: str Address: str - Categories: str + Categories: list[str] class TrashboxRequest(TrashboxBase): Category: str