From 2a4f5a475512ae6c9c4e85d90ea25718f2639cbe Mon Sep 17 00:00:00 2001 From: Stacy Date: Mon, 1 Apr 2024 18:31:59 +0800 Subject: [PATCH] Dynamic API Endpoint Issues --- vendor-payments.php | 4 +++- vendor-payouts.php | 3 ++- wishlist.php | 8 ++++---- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/vendor-payments.php b/vendor-payments.php index c749025..8301680 100644 --- a/vendor-payments.php +++ b/vendor-payments.php @@ -470,7 +470,9 @@ if (is_array($vendorDecode)) { ?> $.ajax({ - url: 'https://api.obanana.shop/api/v1/orders/' + orderId, + + // url: 'https://api.obanana.shop/api/v1/orders/' + orderId, + url: 'https:///api/v1/orders/' + orderId, type: 'GET', headers: { 'Authorization': 'Bearer ' + token diff --git a/vendor-payouts.php b/vendor-payouts.php index 5b84f9c..217b8fe 100644 --- a/vendor-payouts.php +++ b/vendor-payouts.php @@ -618,7 +618,8 @@ $vendorPayoutData = json_decode($response, true); var token = ""; $('#payoutIdSpan').text(payoutId); $.ajax({ - url: 'https://api.obanana.shop/api/v1/payouts/' + payoutId, + // url: 'https://api.obanana.shop/api/v1/payouts/' + payoutId, + url: 'https:///api/v1/payouts/' + payoutId, type: 'GET', headers: { 'Authorization': 'Bearer ' + token diff --git a/wishlist.php b/wishlist.php index b1f3ba1..8b3db96 100644 --- a/wishlist.php +++ b/wishlist.php @@ -1,5 +1,3 @@ - - "") { // Make an AJAX request to update the favorites with the remaining products var xhr = new XMLHttpRequest(); - xhr.open('PATCH', 'https://api.obanana.shop/api/v1/customers/' + customerId, true); + // xhr.open('PATCH', 'https://api.obanana.shop/api/v1/customers/' + customerId, true); + xhr.open('PATCH', 'https:///api/v1/customers/' + customerId, true); xhr.setRequestHeader('Content-Type', 'application/json'); xhr.onreadystatechange = function() { if (xhr.readyState === XMLHttpRequest.DONE) { @@ -360,7 +359,8 @@ if ($_SESSION["userId"] <> "") { // Function to delete multiple products function deleteProducts(productIds) { var xhr = new XMLHttpRequest(); - xhr.open('PATCH', 'https://api.obanana.shop/api/v1/customers/' + customerId, true); + // xhr.open('PATCH', 'https://api.obanana.shop/api/v1/customers/' + customerId, true); + xhr.open('PATCH', 'https:///api/v1/customers/' + customerId, true); xhr.setRequestHeader('Content-Type', 'application/json'); xhr.onreadystatechange = function() { if (xhr.readyState === XMLHttpRequest.DONE) {