@mediocre/walmart-marketplace
Advanced tools
Comparing version 1.4.0 to 1.4.1
22
index.js
@@ -449,16 +449,18 @@ const crypto = require('crypto'); | ||
const fetchOrders = async cursor => { | ||
const queryParameters = new URLSearchParams(); | ||
let url; | ||
['createdEndDate', 'createdStartDate', 'customerOrderId', 'fromExpectedShipDate', 'lastModifiedEndDate', 'lastModifiedStartDate', 'limit', 'orderType', 'productInfo', 'purchaseOrderId', 'replacementInfo', 'shipNodeType', 'shippingProgramType', 'sku', 'status', 'toExpectedShipDate'].forEach(key => { | ||
if (Object.hasOwn(options, key)) { | ||
queryParameters.set(key, options[key]); | ||
} | ||
}); | ||
if (cursor) { | ||
url = `${_options.url}/v3/orders?${cursor}`; | ||
} else { | ||
const queryParameters = new URLSearchParams(); | ||
if (cursor) { | ||
queryParameters.set('nextCursor', cursor); | ||
['createdEndDate', 'createdStartDate', 'customerOrderId', 'fromExpectedShipDate', 'lastModifiedEndDate', 'lastModifiedStartDate', 'limit', 'orderType', 'productInfo', 'purchaseOrderId', 'replacementInfo', 'shipNodeType', 'shippingProgramType', 'sku', 'status', 'toExpectedShipDate'].forEach(key => { | ||
if (Object.hasOwn(options, key)) { | ||
queryParameters.set(key, options[key]); | ||
} | ||
}); | ||
url = `${_options.url}/v3/orders?${queryParameters.toString()}`; | ||
} | ||
const url = `${_options.url}/v3/orders?${queryParameters.toString()}`; | ||
const response = await fetch(url, { | ||
@@ -465,0 +467,0 @@ headers: { |
@@ -20,3 +20,3 @@ { | ||
}, | ||
"version": "1.4.0" | ||
"version": "1.4.1" | ||
} |
97305
755