Fix: use USER_URL for get users, PROFILE_URL for save
This commit is contained in:
+5
-4
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user