From 095ab07ebb5a6ff98cdfbc24ef2ba1eb2cb0d160 Mon Sep 17 00:00:00 2001 From: pi3c Date: Tue, 6 Feb 2024 15:25:19 +0300 Subject: [PATCH] =?UTF-8?q?fix:=20typehint=20=D0=B2=20routes?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- fastfood/routers/dish.py | 8 ++++---- fastfood/routers/menu.py | 10 +++++----- fastfood/routers/submenu.py | 10 +++++----- 3 files changed, 14 insertions(+), 14 deletions(-) diff --git a/fastfood/routers/dish.py b/fastfood/routers/dish.py index b23ac1b..c438e92 100644 --- a/fastfood/routers/dish.py +++ b/fastfood/routers/dish.py @@ -29,7 +29,7 @@ async def create_dish( dish_data: DishBase, dish: DishService = Depends(), background_tasks: BackgroundTasks = BackgroundTasks(), -): +) -> Dish: return await dish.create_dish( menu_id, submenu_id, @@ -44,7 +44,7 @@ async def get_dish( dish_id: UUID, dish: DishService = Depends(), background_tasks: BackgroundTasks = BackgroundTasks(), -): +) -> Dish: result = await dish.read_dish( menu_id, submenu_id, @@ -63,7 +63,7 @@ async def update_dish( dish_data: DishBase, dish: DishService = Depends(), background_tasks: BackgroundTasks = BackgroundTasks(), -): +) -> Dish: result = await dish.update_dish( menu_id, submenu_id, @@ -80,5 +80,5 @@ async def delete_dish( dish_id: UUID, dish: DishService = Depends(), background_tasks: BackgroundTasks = BackgroundTasks(), -): +) -> None: await dish.del_dish(menu_id, submenu_id, dish_id) diff --git a/fastfood/routers/menu.py b/fastfood/routers/menu.py index 5c638e7..3ed743e 100644 --- a/fastfood/routers/menu.py +++ b/fastfood/routers/menu.py @@ -15,7 +15,7 @@ router = APIRouter( async def get_menus( menu: MenuService = Depends(), background_tasks: BackgroundTasks = BackgroundTasks(), -): +) -> list[MenuRead]: return await menu.read_menus() @@ -24,7 +24,7 @@ async def add_menu( menu: MenuBase, responce: MenuService = Depends(), background_tasks: BackgroundTasks = BackgroundTasks(), -): +) -> MenuRead: return await responce.create_menu(menu) @@ -33,7 +33,7 @@ async def get_menu( menu_id: UUID, responce: MenuService = Depends(), background_tasks: BackgroundTasks = BackgroundTasks(), -): +) -> MenuRead: result = await responce.read_menu(menu_id=menu_id) if not result: @@ -47,7 +47,7 @@ async def update_menu( menu: MenuBase, responce: MenuService = Depends(), background_tasks: BackgroundTasks = BackgroundTasks(), -): +) -> MenuRead: result = await responce.update_menu( menu_id=menu_id, menu_data=menu, @@ -60,5 +60,5 @@ async def delete_menu( menu_id: UUID, menu: MenuService = Depends(), background_tasks: BackgroundTasks = BackgroundTasks(), -): +) -> None: await menu.del_menu(menu_id) diff --git a/fastfood/routers/submenu.py b/fastfood/routers/submenu.py index 6206e78..55e1060 100644 --- a/fastfood/routers/submenu.py +++ b/fastfood/routers/submenu.py @@ -16,7 +16,7 @@ async def get_submenus( menu_id: UUID, submenu: SubmenuService = Depends(), background_tasks: BackgroundTasks = BackgroundTasks(), -): +) -> list[SubMenuRead]: result = await submenu.read_submenus(menu_id=menu_id) return result @@ -27,7 +27,7 @@ async def create_submenu_item( submenu_data: MenuBase, submenu: SubmenuService = Depends(), background_tasks: BackgroundTasks = BackgroundTasks(), -): +) -> SubMenuRead: result = await submenu.create_submenu( menu_id=menu_id, submenu_data=submenu_data, @@ -41,7 +41,7 @@ async def get_submenu( submenu_id: UUID, submenu: SubmenuService = Depends(), background_tasks: BackgroundTasks = BackgroundTasks(), -): +) -> SubMenuRead: result = await submenu.read_menu( menu_id=menu_id, submenu_id=submenu_id, @@ -61,7 +61,7 @@ async def update_submenu( submenu_data: MenuBase, submenu: SubmenuService = Depends(), background_tasks: BackgroundTasks = BackgroundTasks(), -): +) -> SubMenuRead: result = await submenu.update_submenu( menu_id=menu_id, submenu_id=submenu_id, @@ -76,5 +76,5 @@ async def delete_submenu( submenu_id: UUID, submenu: SubmenuService = Depends(), background_tasks: BackgroundTasks = BackgroundTasks(), -): +) -> None: await submenu.del_menu(menu_id=menu_id, submenu_id=submenu_id)