"Fix-order-details-for-customers"

This commit is contained in:
sysadmin
2025-08-27 23:35:30 +01:00
parent 1829e5c940
commit 5748ed4a09
8 changed files with 103 additions and 18 deletions

View File

@@ -72,6 +72,19 @@ public class OrdersController : ControllerBase
return Ok(orders);
}
[HttpGet("by-customer/{customerId}/{id}")]
[AllowAnonymous]
public async Task<ActionResult<OrderDto>> GetOrderByCustomerId(Guid customerId, Guid id)
{
var order = await _orderService.GetOrderByIdAsync(id);
if (order == null || order.CustomerId != customerId)
{
return NotFound();
}
return Ok(order);
}
[HttpGet("by-identity/{identityReference}/{id}")]
[AllowAnonymous]
public async Task<ActionResult<OrderDto>> GetOrderByIdentity(string identityReference, Guid id)