Skip to content
This repository has been archived by the owner on Jan 17, 2025. It is now read-only.

Fix route URL double slashes #6

Merged
merged 1 commit into from
Feb 2, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions includes/assets/ctb.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
let ctbId = e.target.getAttribute('data-ctb-id');
e.target.closest('.ctb-actions').innerHTML = '<div class="ctb-loader"></div>';
window.fetch(
`${ window.NewfoldRuntime.restUrl }/newfold-ctb/v1/ctb/${ ctbId }`,
`${ window.NewfoldRuntime.restUrl }newfold-ctb/v1/ctb/${ ctbId }`,
{
credentials: 'same-origin',
method: 'POST',
Expand Down Expand Up @@ -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: {
Expand Down Expand Up @@ -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');
Expand All @@ -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',
Expand Down Expand Up @@ -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
Expand Down