diff --git a/.env.production b/.env.production index ed3ca4d..3ee7b34 100644 --- a/.env.production +++ b/.env.production @@ -1,2 +1,3 @@ # Ici, on force React à tirer sur le bon domaine une fois en ligne ! -VITE_API_BASE_URL=https://web.gise.be/index.php?_url= \ No newline at end of file +VITE_API_BASE_URL=https://web.gise.be/index.php?_url= +VITE_CUSTOM_API_BASE_URL=https://web.gise.be \ No newline at end of file diff --git a/src/services/api.js b/src/services/api.js index 90a66e8..b0031fb 100644 --- a/src/services/api.js +++ b/src/services/api.js @@ -1,4 +1,5 @@ const BASE_URL = import.meta.env.VITE_API_BASE_URL || ''; +const CUSTOM_API_BASE_URL = import.meta.env.VITE_CUSTOM_API_BASE_URL || ''; const apiCall = async (url, body = null) => { // Configuration de base pour l'appel réseau @@ -53,7 +54,7 @@ export const getProductList = () => export const registerUnifiedClient = async (email, username, password, firstName, lastName) => { try { // Utilisation des backticks ici aussi ! - const response = await fetch(`${BASE_URL}/custom_api/signup.php`, { + const response = await fetch(`${CUSTOM_API_BASE_URL}/custom_api/signup.php`, { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({