From 4b0614fec76c26325d4b70e70eab859294db2f20 Mon Sep 17 00:00:00 2001 From: tavo Date: Sun, 22 Sep 2024 10:20:55 -0600 Subject: [PATCH] api --- public/client.js | 10 +++++----- public/paypal.js | 4 ++-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/public/client.js b/public/client.js index 587cf70..33338b1 100644 --- a/public/client.js +++ b/public/client.js @@ -271,7 +271,7 @@ function validateDirectoryLength(directory) { } function checkDirectoryExists(directory) { - return fetch(`/api/directory/${encodeURIComponent(directory)}`) + return fetch(`https://api.conex.one/api/directory/${encodeURIComponent(directory)}`) .then(response => response.json()) .then(data => data.exists) .catch(error => { @@ -339,7 +339,7 @@ function handleImageUpload() { loader.style.display = 'inline-block'; imageIcon.style.display = 'none'; - fetch('/api/upload', { + fetch('https://api.conex.one/api/upload', { method: 'POST', body: formData, }).then(response => response.json()).then(data => { @@ -491,7 +491,7 @@ async function editMode(dir) { async function fetchAndStoreData(directoryName) { try { - const response = await fetch(`/api/fetch/${encodeURIComponent(directoryName)}`); + const response = await fetch(`https://api.conex.one/api/fetch/${encodeURIComponent(directoryName)}`); if (!response.ok) { throw new Error(`Failed to fetch data for directory: ${directoryName}`); } @@ -514,7 +514,7 @@ function updateSiteRequest() { successElement = document.getElementById('update-success-message'); errorElement = document.getElementById('update-error-message'); - fetch('/api/update', { + fetch('https://api.conex.one/api/update', { method: 'POST', headers: { 'Content-Type': 'application/json', @@ -548,7 +548,7 @@ function updateSiteConfirm(code) { return; } - fetch('/api/confirm', { + fetch('https://api.conex.one/api/confirm', { method: 'POST', headers: { 'Content-Type': 'application/json', diff --git a/public/paypal.js b/public/paypal.js index 5f6f0e8..fc5b6a3 100644 --- a/public/paypal.js +++ b/public/paypal.js @@ -10,7 +10,7 @@ paypal.Buttons({ const requestData = { directory: savedData.directory, }; - const response = await fetch("/api/orders", { + const response = await fetch("https://api.conex.one/api/orders", { method: "POST", headers: { "Content-Type": "application/json", @@ -55,7 +55,7 @@ paypal.Buttons({ editor_data: savedData.editor_data }; - const response = await fetch(`/api/orders/${data.orderID}/capture`, { + const response = await fetch(`https://api.conex.one/api/orders/${data.orderID}/capture`, { method: "POST", headers: { "Content-Type": "application/json",