@nuskin/ns-shop 7.0.5-cx1-13272.12 → 7.0.5-cx1-13272.13
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 +1 -1
- package/src/salesEventService.js +9 -6
package/package.json
CHANGED
package/src/salesEventService.js
CHANGED
|
@@ -531,7 +531,7 @@ async function _getRemoteTicket(eventTicketInfo) {
|
|
|
531
531
|
response = await axios({
|
|
532
532
|
method: method,
|
|
533
533
|
url: `${_getAwsUrl(eventName, ticketId)}${seParams}`,
|
|
534
|
-
headers: _getHeaders(),
|
|
534
|
+
headers: _getHeaders(method === 'GET' ? true : false),
|
|
535
535
|
timeout: 7000
|
|
536
536
|
});
|
|
537
537
|
|
|
@@ -646,11 +646,14 @@ function _getAwsUrl(eventName, ticketId) {
|
|
|
646
646
|
* @returns {{Accept: string, "Content-Type": string, client_id: *}}
|
|
647
647
|
* @private
|
|
648
648
|
*/
|
|
649
|
-
function _getHeaders() {
|
|
649
|
+
function _getHeaders(noCache = false) {
|
|
650
650
|
return {
|
|
651
651
|
'Accept': 'application/json',
|
|
652
652
|
'Content-Type': 'application/json',
|
|
653
|
-
'client_id': RunConfigService.getRunConfig().clientId
|
|
653
|
+
'client_id': RunConfigService.getRunConfig().clientId,
|
|
654
|
+
...(noCache && {'Cache-Control': 'no-cache'}),
|
|
655
|
+
...(noCache && {'Pragma': 'no-cache'}),
|
|
656
|
+
...(noCache && {'Expires': '0'})
|
|
654
657
|
};
|
|
655
658
|
}
|
|
656
659
|
|
|
@@ -658,7 +661,7 @@ async function _getActiveEvents() {
|
|
|
658
661
|
let response = await axios({
|
|
659
662
|
method: 'GET',
|
|
660
663
|
url: `${_getAwsUrl()}?activeWithin=${ACTIVE_EVENT_WITHIN}`,
|
|
661
|
-
headers: _getHeaders()
|
|
664
|
+
headers: _getHeaders(true)
|
|
662
665
|
});
|
|
663
666
|
return response.data.salesEventResponse
|
|
664
667
|
}
|
|
@@ -739,7 +742,7 @@ async function _loadMarketEventConfig(force, country=undefined) {
|
|
|
739
742
|
const response = await axios({
|
|
740
743
|
method: 'GET',
|
|
741
744
|
url: `${_getAwsUrl()}`,
|
|
742
|
-
headers: _getHeaders()
|
|
745
|
+
headers: _getHeaders(true)
|
|
743
746
|
});
|
|
744
747
|
const salesEvents = response.data.salesEventResponse || [];
|
|
745
748
|
mktEventConfigMap = {};
|
|
@@ -835,7 +838,7 @@ async function _initializePolling() {
|
|
|
835
838
|
if (window.location.pathname === '/static/checkout/checkout.html') {
|
|
836
839
|
// check for missing tickets. Only perform on checkout s
|
|
837
840
|
const activeEvents = await _getActiveEvents();
|
|
838
|
-
myAlert(`Active Event check, ${activeEventMap}`);
|
|
841
|
+
myAlert(`Active Event check, ${JSON.stringify(activeEventMap)}`);
|
|
839
842
|
|
|
840
843
|
for (const eventInfo of activeEvents) {
|
|
841
844
|
await _checkForMissingTicket(eventInfo.eventName);
|