Skip to content

Commit

Permalink
Refatorar rota de exclusão de pedido para utilizar identificador como…
Browse files Browse the repository at this point in the history
… parâmetro
  • Loading branch information
maxsonferovante committed Oct 15, 2024
1 parent 21855f7 commit 1a164b2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions src/apps/order/order_controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion src/apps/order/order_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 1a164b2

Please sign in to comment.