From b0576ee9b8626fb24a9df2ec95acb0e584cc8c3a Mon Sep 17 00:00:00 2001 From: Sumit Ghosh Date: Thu, 21 Oct 2021 14:21:46 +0530 Subject: [PATCH] Fixed bugs in Web.Bff.Shopping aggregator project --- .../Web.Bff.Shopping/aggregator/Controllers/BasketController.cs | 2 +- .../Web.Bff.Shopping/aggregator/Controllers/OrderController.cs | 2 +- .../Infrastructure/HttpClientAuthorizationDelegatingHandler.cs | 2 +- .../Web.Bff.Shopping/aggregator/Services/BasketService.cs | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/ApiGateways/Web.Bff.Shopping/aggregator/Controllers/BasketController.cs b/src/ApiGateways/Web.Bff.Shopping/aggregator/Controllers/BasketController.cs index 008ded21b..143ff9a2b 100644 --- a/src/ApiGateways/Web.Bff.Shopping/aggregator/Controllers/BasketController.cs +++ b/src/ApiGateways/Web.Bff.Shopping/aggregator/Controllers/BasketController.cs @@ -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) diff --git a/src/ApiGateways/Web.Bff.Shopping/aggregator/Controllers/OrderController.cs b/src/ApiGateways/Web.Bff.Shopping/aggregator/Controllers/OrderController.cs index 5897a5c86..448bbec85 100644 --- a/src/ApiGateways/Web.Bff.Shopping/aggregator/Controllers/OrderController.cs +++ b/src/ApiGateways/Web.Bff.Shopping/aggregator/Controllers/OrderController.cs @@ -20,7 +20,7 @@ public class OrderController : ControllerBase [ProducesResponseType(typeof(OrderData), (int)HttpStatusCode.OK)] public async Task> GetOrderDraftAsync(string basketId) { - if (string.IsNullOrWhitespace(basketId)) + if (string.IsNullOrWhiteSpace(basketId)) { return BadRequest("Need a valid basketid"); } diff --git a/src/ApiGateways/Web.Bff.Shopping/aggregator/Infrastructure/HttpClientAuthorizationDelegatingHandler.cs b/src/ApiGateways/Web.Bff.Shopping/aggregator/Infrastructure/HttpClientAuthorizationDelegatingHandler.cs index a024560c6..d9b3b0ee1 100644 --- a/src/ApiGateways/Web.Bff.Shopping/aggregator/Infrastructure/HttpClientAuthorizationDelegatingHandler.cs +++ b/src/ApiGateways/Web.Bff.Shopping/aggregator/Infrastructure/HttpClientAuthorizationDelegatingHandler.cs @@ -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() { authorizationHeader }); } diff --git a/src/ApiGateways/Web.Bff.Shopping/aggregator/Services/BasketService.cs b/src/ApiGateways/Web.Bff.Shopping/aggregator/Services/BasketService.cs index 64feecfa2..af5e6adc4 100644 --- a/src/ApiGateways/Web.Bff.Shopping/aggregator/Services/BasketService.cs +++ b/src/ApiGateways/Web.Bff.Shopping/aggregator/Services/BasketService.cs @@ -12,7 +12,7 @@ public class BasketService : IBasketService } - public async Task GetById(string id) + public async Task GetByIdAsync(string id) { _logger.LogDebug("grpc client created, request = {@id}", id); var response = await _basketClient.GetBasketByIdAsync(new BasketRequest { Id = id });