@nuskin/ns-shop 5.16.0 → 5.17.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -156,14 +156,28 @@ async function getVNRegionList () {
|
|
|
156
156
|
* @return {Promise<PostalCodeLookupDTO[]>} Promise that resolves to address data set
|
|
157
157
|
*/
|
|
158
158
|
async function getListOfCitiesFromPostalCode (country, zip) {
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
159
|
+
const {
|
|
160
|
+
awsUrl,
|
|
161
|
+
checkout: { postalCodeServiceUrl }
|
|
162
|
+
} = ConfigService.getMarketConfig();
|
|
163
|
+
|
|
164
|
+
let url;
|
|
165
|
+
if (country === 'MX') {
|
|
166
|
+
url = `${awsUrl}/mexico-check/v1/zzip/${zip}`;
|
|
167
|
+
} else {
|
|
168
|
+
url = postalCodeServiceUrl
|
|
169
|
+
.replace(/:cntry/g, country)
|
|
170
|
+
.replace(/:code/g, zip);
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
const results = await fetch(url, {
|
|
162
174
|
method: 'GET',
|
|
163
175
|
credentials: 'omit',
|
|
164
176
|
headers: ServiceUtils.getHeaders()
|
|
165
177
|
})
|
|
166
178
|
.then(ServiceUtils.transformFetchResponse);
|
|
179
|
+
|
|
180
|
+
return (country === 'MX') ? results.zzipRecords : results;
|
|
167
181
|
}
|
|
168
182
|
|
|
169
183
|
/**
|