From b2d7d4d9184b8763629cb6de12922fd5c2e7cac3 Mon Sep 17 00:00:00 2001 From: William Earnhardt Date: Sat, 28 Oct 2023 06:08:05 -0400 Subject: [PATCH] Remove leading slash for route path --- includes/assets/ctb.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/includes/assets/ctb.js b/includes/assets/ctb.js index 5da5916..029175e 100644 --- a/includes/assets/ctb.js +++ b/includes/assets/ctb.js @@ -4,7 +4,7 @@ let ctbId = e.target.getAttribute('data-ctb-id'); e.target.closest('.ctb-actions').innerHTML = '
'; window.fetch( - `${ window.NewfoldRuntime.restUrl }/newfold-ctb/v1/ctb/${ ctbId }`, + `${ window.NewfoldRuntime.restUrl }newfold-ctb/v1/ctb/${ ctbId }`, { credentials: 'same-origin', method: 'POST', @@ -34,7 +34,7 @@ let modal = openModal(e, ctbId); let modalWindow = modal.querySelector('.ctb-modal-content'); window.fetch( - `${ window.NewfoldRuntime.restUrl }/newfold-ctb/v1/ctb/${ ctbId }`, + `${ window.NewfoldRuntime.restUrl }newfold-ctb/v1/ctb/${ ctbId }`, { credentials: 'same-origin', headers: { @@ -88,10 +88,10 @@ document.querySelector('body').classList.add('noscroll'); purchaseStatus = false; - + return ctbContainer; } - + const closeModal = (e) => { ctbmodal.destroy(); document.querySelector('body').classList.remove('noscroll'); @@ -113,7 +113,7 @@ if (notice) { notice.parentNode.removeChild(notice); window.fetch( - `${ window.NewfoldRuntime.restUrl }/newfold-notifications/v1/notifications/${ notice.dataset.id }`, + `${ window.NewfoldRuntime.restUrl }newfold-notifications/v1/notifications/${ notice.dataset.id }`, { credentials: 'same-origin', method: 'DELETE', @@ -143,7 +143,7 @@ () => { document.getElementById('wpwrap').addEventListener('click', function(event) { if (event.target.dataset.action === 'load-nfd-ctb') { - if ( + if ( ! supportsGlobalCTB() && // can NOT access global ctb window.nfdctb.supportsCTB // but does support legacy ctb ) { // has token and customer id