From 600e5e7904f54ff10744972664e97085915ca6e5 Mon Sep 17 00:00:00 2001 From: Kato Date: Wed, 2 Sep 2026 20:35:39 +0000 Subject: [PATCH] Fix: use USER_URL for get users, PROFILE_URL for save --- js/main.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/js/main.js b/js/main.js index b6414fc..a81a64e 100644 --- a/js/main.js +++ b/js/main.js @@ -17,7 +17,8 @@ function setCookie(name, value, days) { const API_URL = 'https://n8n.odoo4projects.com/webhook/paraguay/login'; const NEWSLETTER_URL = 'https://n8n.odoo4projects.com/webhook/paraguay/newsletter'; -const PROFILE_URL = 'https://n8n.odoo4projects.com/webhook/paraguay/user'; +const USER_URL = 'https://n8n.odoo4projects.com/webhook/paraguay/user'; +const PROFILE_URL = 'https://n8n.odoo4projects.com/webhook/paraguay/profile'; function checkSession() { const sessionid = getCookie('sessionid'); @@ -215,9 +216,9 @@ async function subscribeNewsletter() { async function loadUsers() { const usersContainer = document.getElementById('users-list'); if (!usersContainer) return; - console.log('loadUsers: starting fetch from', PROFILE_URL); + console.log('loadUsers: starting fetch from', USER_URL); try { - const response = await fetch(PROFILE_URL); + const response = await fetch(USER_URL); console.log('loadUsers: response status =', response.status); if (!response.ok) throw new Error('Failed to fetch users'); const data = await response.json(); @@ -264,7 +265,7 @@ async function openProfileModal() { const sessionid = getCookie('sessionid'); if (!sessionid) { alert('Bitte melden Sie sich an.'); return; } try { - const response = await fetch(PROFILE_URL + '?sessionid=' + encodeURIComponent(sessionid)); + const response = await fetch(USER_URL + '?sessionid=' + encodeURIComponent(sessionid)); console.log('openProfileModal response:', response.status, await response.clone().json()); if (response.ok) { const user = await response.json();