Browse Source

Fixed bugs in Web.Bff.Shopping aggregator project

pull/1774/head
Sumit Ghosh 3 years ago
parent
commit
b0576ee9b8
4 changed files with 4 additions and 4 deletions
  1. +1
    -1
      src/ApiGateways/Web.Bff.Shopping/aggregator/Controllers/BasketController.cs
  2. +1
    -1
      src/ApiGateways/Web.Bff.Shopping/aggregator/Controllers/OrderController.cs
  3. +1
    -1
      src/ApiGateways/Web.Bff.Shopping/aggregator/Infrastructure/HttpClientAuthorizationDelegatingHandler.cs
  4. +1
    -1
      src/ApiGateways/Web.Bff.Shopping/aggregator/Services/BasketService.cs

+ 1
- 1
src/ApiGateways/Web.Bff.Shopping/aggregator/Controllers/BasketController.cs View File

@ -124,7 +124,7 @@ public class BasketController : ControllerBase
//item.PictureUri =
// Step 2: Get current basket status
var currentBasket = (await _basket.GetById(data.BasketId)) ?? new BasketData(data.BasketId);
var currentBasket = (await _basket.GetByIdAsync(data.BasketId)) ?? new BasketData(data.BasketId);
// Step 3: Search if exist product into basket
var product = currentBasket.Items.SingleOrDefault(i => i.ProductId == item.Id);
if (product != null)


+ 1
- 1
src/ApiGateways/Web.Bff.Shopping/aggregator/Controllers/OrderController.cs View File

@ -20,7 +20,7 @@ public class OrderController : ControllerBase
[ProducesResponseType(typeof(OrderData), (int)HttpStatusCode.OK)]
public async Task<ActionResult<OrderData>> GetOrderDraftAsync(string basketId)
{
if (string.IsNullOrWhitespace(basketId))
if (string.IsNullOrWhiteSpace(basketId))
{
return BadRequest("Need a valid basketid");
}


+ 1
- 1
src/ApiGateways/Web.Bff.Shopping/aggregator/Infrastructure/HttpClientAuthorizationDelegatingHandler.cs View File

@ -15,7 +15,7 @@ public class HttpClientAuthorizationDelegatingHandler
var authorizationHeader = _httpContextAccessor.HttpContext
.Request.Headers["Authorization"];
if (!string.IsNullOrWhitespace(authorizationHeader))
if (!string.IsNullOrWhiteSpace(authorizationHeader))
{
request.Headers.Add("Authorization", new List<string>() { authorizationHeader });
}


+ 1
- 1
src/ApiGateways/Web.Bff.Shopping/aggregator/Services/BasketService.cs View File

@ -12,7 +12,7 @@ public class BasketService : IBasketService
}
public async Task<BasketData> GetById(string id)
public async Task<BasketData> GetByIdAsync(string id)
{
_logger.LogDebug("grpc client created, request = {@id}", id);
var response = await _basketClient.GetBasketByIdAsync(new BasketRequest { Id = id });


Loading…
Cancel
Save