Auditoria funcionando

This commit is contained in:
2026-02-12 12:23:11 -07:00
parent 96084b89c0
commit 96cd09476c
24 changed files with 2363 additions and 37 deletions

View File

@@ -4,6 +4,9 @@
import { toast } from '$lib/stores/toast.js';
import { onMount } from 'svelte';
// API Configuration
const API_URL = import.meta.env.VITE_API_URL || 'http://localhost:8000';
let currentPassword = '';
let newPassword = '';
let confirmPassword = '';
@@ -82,7 +85,7 @@
return;
}
const response = await fetch('/api/v1/client-profile/', {
const response = await fetch(`${API_URL}/v1/client-profile/`, {
headers: {
Authorization: `Bearer ${$auth.token}`,
'X-Tenant-ID': $auth.user.tenant_id
@@ -185,7 +188,7 @@
isUpdatingProfile = true;
try {
const response = await fetch('/api/v1/auth/profile', {
const response = await fetch(`${API_URL}/v1/auth/profile`, {
method: 'PATCH',
headers: {
'Content-Type': 'application/json',
@@ -218,7 +221,7 @@
isChangingPassword = true;
try {
const response = await fetch('/api/v1/auth/change-password', {
const response = await fetch(`${API_URL}/v1/auth/change-password`, {
method: 'POST',
headers: {
'Content-Type': 'application/json',
@@ -269,7 +272,7 @@
profileData.credit_limit = parseFloat(profileData.credit_limit);
}
const response = await fetch('/api/v1/client-profile/', {
const response = await fetch(`${API_URL}/v1/client-profile/`, {
method: 'POST',
headers: {
'Content-Type': 'application/json',