|
|
@@ -58,12 +58,12 @@
|
|
|
try {
|
|
|
loadError = '';
|
|
|
loadServerResponse = '';
|
|
|
- console.log('cookie company_id:', getCookie('company_id'));
|
|
|
+ //console.log('cookie company_id:', getCookie('company_id'));
|
|
|
const cid = getCompanyIdValue();
|
|
|
- console.log('resolved companyId:', cid);
|
|
|
+ //console.log('resolved companyId:', cid);
|
|
|
if (!cid) throw new Error('company_id não encontrado.');
|
|
|
const url = `${apiUrl}/user/get`;
|
|
|
- console.log('fetch url:', url);
|
|
|
+ //console.log('fetch url:', url);
|
|
|
const res = await fetch(url, {
|
|
|
method: 'POST',
|
|
|
headers: {
|
|
|
@@ -74,7 +74,7 @@
|
|
|
});
|
|
|
const raw = await res.text();
|
|
|
loadServerResponse = raw?.trim() ?? '';
|
|
|
- console.log('response raw body:', raw);
|
|
|
+ //console.log('response raw body:', raw);
|
|
|
let body = null;
|
|
|
if (raw) {
|
|
|
try {
|
|
|
@@ -88,14 +88,14 @@
|
|
|
throw new Error(body?.msg ?? 'Falha ao carregar usuários.');
|
|
|
}
|
|
|
const list = Array.isArray(body?.data) ? body.data : [];
|
|
|
- console.log('parsed users length:', list.length);
|
|
|
+ //console.log('parsed users length:', list.length);
|
|
|
data = list.map((u) => ({
|
|
|
__raw: u,
|
|
|
name: u?.name ?? u?.user_name ?? u?.userName ?? u?.fullName ?? '-',
|
|
|
email: u?.email ?? u?.user_email ?? u?.userEmail ?? '-'
|
|
|
}));
|
|
|
} catch (e) {
|
|
|
- console.log('fetch users error:', e);
|
|
|
+ //console.log('fetch users error:', e);
|
|
|
loadError = e?.message ?? 'Falha ao carregar usuários.';
|
|
|
data = [];
|
|
|
} finally {
|
|
|
@@ -128,7 +128,7 @@
|
|
|
body: JSON.stringify(requestBody)
|
|
|
});
|
|
|
const raw = await res.text();
|
|
|
- console.log('create user raw body:', raw);
|
|
|
+ //console.log('create user raw body:', raw);
|
|
|
let body = null;
|
|
|
if (raw) {
|
|
|
try {
|
|
|
@@ -171,7 +171,7 @@
|
|
|
const { row } = e?.detail || {};
|
|
|
if (!row) return;
|
|
|
selectedUser = row.__raw ?? row;
|
|
|
- console.log('clicked user details:', selectedUser);
|
|
|
+ //console.log('clicked user details:', selectedUser);
|
|
|
showDetails = true;
|
|
|
}
|
|
|
|
|
|
@@ -207,7 +207,7 @@
|
|
|
body: JSON.stringify({ user_id: userId, company_id: cid })
|
|
|
});
|
|
|
const raw = await res.text();
|
|
|
- console.log('delete user raw body:', raw);
|
|
|
+ //console.log('delete user raw body:', raw);
|
|
|
let body = null;
|
|
|
if (raw) {
|
|
|
try {
|