"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)
|
||||
|
||||
@@ -73,7 +73,8 @@ builder.Services.AddScoped<IBotMetricsService, BotMetricsService>();
|
||||
builder.Services.AddScoped<ICustomerService, CustomerService>();
|
||||
builder.Services.AddScoped<ICustomerMessageService, CustomerMessageService>();
|
||||
builder.Services.AddSingleton<ITelegramBotManagerService, TelegramBotManagerService>();
|
||||
builder.Services.AddHostedService<TelegramBotManagerService>();
|
||||
// Temporarily disabled to use standalone TeleBot with customer orders fix
|
||||
// builder.Services.AddHostedService<TelegramBotManagerService>();
|
||||
|
||||
// AutoMapper
|
||||
builder.Services.AddAutoMapper(typeof(Program));
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Reference in New Issue
Block a user