From 56a12122cc7453fafe6bb5f7178218ea37cdfe48 Mon Sep 17 00:00:00 2001 From: Tareq Abuzuhri Date: Fri, 4 Mar 2022 09:07:02 +0100 Subject: [PATCH] Fix bug #127 --- Source/FikaAmazonAPI/Services/OrderService.cs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Source/FikaAmazonAPI/Services/OrderService.cs b/Source/FikaAmazonAPI/Services/OrderService.cs index 93e9f597..57512f72 100644 --- a/Source/FikaAmazonAPI/Services/OrderService.cs +++ b/Source/FikaAmazonAPI/Services/OrderService.cs @@ -34,22 +34,22 @@ public async Task GetOrdersAsync(ParameterOrderList searchOrderList) orderList = response.Payload.Orders; while (!string.IsNullOrEmpty(nextToken)) { - var orderPayload = GetGetOrdersByNextToken(nextToken, searchOrderList.MarketplaceIds); + var orderPayload = GetGetOrdersByNextToken(nextToken, searchOrderList); orderList.AddRange(orderPayload.Orders); nextToken = orderPayload.NextToken; } return orderList; } - public OrdersList GetGetOrdersByNextToken(string nextToken, IList marketplaceIds) => - Task.Run(() => GetGetOrdersByNextTokenAsync(nextToken, marketplaceIds)).ConfigureAwait(false).GetAwaiter().GetResult(); - public async Task GetGetOrdersByNextTokenAsync(string nextToken, IList marketplaceIds) + public OrdersList GetGetOrdersByNextToken(string nextToken, ParameterOrderList searchOrderList) => + Task.Run(() => GetGetOrdersByNextTokenAsync(nextToken, searchOrderList)).ConfigureAwait(false).GetAwaiter().GetResult(); + public async Task GetGetOrdersByNextTokenAsync(string nextToken, ParameterOrderList searchOrderList) { List> queryParameters = new List>(); queryParameters.Add(new KeyValuePair("NextToken", nextToken)); - queryParameters.Add(new KeyValuePair("MarketplaceIds", string.Join(",", marketplaceIds))); + queryParameters.Add(new KeyValuePair("MarketplaceIds", string.Join(",", searchOrderList.MarketplaceIds))); - await CreateAuthorizedRequestAsync(OrdersApiUrls.Orders, RestSharp.Method.GET, queryParameters); + await CreateAuthorizedRequestAsync(OrdersApiUrls.Orders, RestSharp.Method.GET, queryParameters, parameter: searchOrderList); var response = await ExecuteRequestAsync(Utils.RateLimitType.Order_GetOrders); return response.Payload; }