Fixed error with creation of document

This commit is contained in:
2026-05-25 12:19:05 +01:00
parent b59a8b6c3d
commit d46fa606b7
5 changed files with 9 additions and 7 deletions
@@ -23,6 +23,7 @@ public class CreatePurchaseOrder(
public override async Task HandleAsync(CreatePurchaseOrderDto req, CancellationToken ct)
{
PurchaseOrder purchaseOrder = mapper.Map<PurchaseOrder>(req);
await purchaseOrdersRepository.AddAsync(purchaseOrder, ct);
if (req.Products != null)
{
@@ -49,8 +50,6 @@ public class CreatePurchaseOrder(
await purchaseProductsRepository.AddAsync(productOnPurchase, ct);
}
}
await purchaseOrdersRepository.AddAsync(purchaseOrder, ct);
await Send.NoContentAsync(ct);
}
}