refactor: entity not found exceptions handler
This commit is contained in:
@ -53,14 +53,8 @@ class DealProductService(ServiceGetAllMixin[DealProduct, DealProductSchema]):
|
||||
) -> DealProductAddKitResponse:
|
||||
services_kit_repo = ServicesKitRepository(self.repository.session)
|
||||
services_kit = await services_kit_repo.get_by_id(request.kit_id)
|
||||
if not services_kit:
|
||||
raise HTTPException(status_code=404, detail="Набор услуг не найден")
|
||||
|
||||
deal_product = await self.repository.get_by_id(
|
||||
request.deal_id, request.product_id
|
||||
)
|
||||
if not deal_product:
|
||||
raise HTTPException(status_code=404, detail=self.entity_not_found_msg)
|
||||
deal_product = await self.repository.get_by_id(request.deal_id, request.product_id)
|
||||
|
||||
product_service_repo = ProductServiceRepository(self.repository.session)
|
||||
await product_service_repo.delete_product_services(
|
||||
|
||||
Reference in New Issue
Block a user