Fixed bugs in Web.Bff.Shopping aggregator project

This commit is contained in:
Sumit Ghosh 2021-10-21 14:21:46 +05:30
parent f1c0db1118
commit b0576ee9b8
4 changed files with 4 additions and 4 deletions

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)

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");
}

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 });
}

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 });