diff --git a/src/apps/order/order_controller.py b/src/apps/order/order_controller.py index b706582..009e265 100644 --- a/src/apps/order/order_controller.py +++ b/src/apps/order/order_controller.py @@ -26,10 +26,10 @@ async def add_order(self, order: OrderCreateDTO) -> Order: print ("Exception - add_order", exception) handlers_order_expections(exception) - @Delete("/delete") - async def delete_order(self, order: OrderFindDTO) -> Order: + @Delete("/{identifier}") + async def delete_order(self, identifier: str) -> Order: try: - return await self.order_service.delete_order(order) + return await self.order_service.delete_order(identifier) except Exception as exception: print ("Exception - delete_order", exception) handlers_order_expections(exception) diff --git a/src/apps/order/order_service.py b/src/apps/order/order_service.py index 3c558e6..b4f656c 100644 --- a/src/apps/order/order_service.py +++ b/src/apps/order/order_service.py @@ -95,7 +95,7 @@ async def get_order_by_identifier(self, identifier: str) -> Order: @db_request_handler - async def delete_order(self, order: OrderFindDTO) -> Order: + async def delete_order(self, identifier) -> Order: order_find = OrderFindDTO(identifier=identifier) order = await OrderEntity.find_one(OrderEntity.identifier == order_find.identifier)