diff --git a/js/main.js b/js/main.js index fd3e206..d640b31 100644 --- a/js/main.js +++ b/js/main.js @@ -17,7 +17,7 @@ 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 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 +215,9 @@ async function subscribeNewsletter() { async function loadUsers() { const usersContainer = document.getElementById('users-list'); if (!usersContainer) return; - console.log('loadUsers: starting fetch from', USER_URL); + console.log('loadUsers: starting fetch from', PROFILE_URL); try { - const response = await fetch(USER_URL); + const response = await fetch(PROFILE_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 +264,7 @@ async function openProfileModal() { const sessionid = getCookie('sessionid'); if (!sessionid) { alert('Bitte melden Sie sich an.'); return; } try { - const response = await fetch(USER_URL, { + const response = await fetch(PROFILE_URL, { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ sessionid: sessionid })