"Fix-order-details-for-customers"
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user