Version con fallas

This commit is contained in:
2026-02-12 14:00:04 -07:00
parent 96cd09476c
commit 2033a35a2b
44 changed files with 196 additions and 3723 deletions

View File

@@ -2,9 +2,6 @@ import type { Writable } from 'svelte/store';
import { get, writable } from 'svelte/store';
import { auth } from './auth';
// API Configuration
const API_URL = import.meta.env.VITE_API_URL || 'http://localhost:8000';
// Types
interface FastAPIValidationError {
loc: (string | number)[];
@@ -87,7 +84,7 @@ async function apiCall(endpoint: string, options: RequestInit = {}) {
throw new Error('Not authenticated');
}
const response = await fetch(`${API_URL}/v1${endpoint}`, {
const response = await fetch(`/api/v1${endpoint}`, {
...options,
headers: {
'Content-Type': 'application/json',
@@ -262,7 +259,7 @@ function createTicketsStore() {
throw new Error('Not authenticated');
}
const response = await fetch(`${API_URL}/v1/tickets/${ticketId}/attachments`, {
const response = await fetch(`/api/v1/tickets/${ticketId}/attachments`, {
method: 'POST',
headers: {
'Authorization': `Bearer ${authState.token}`,
@@ -341,7 +338,7 @@ function createTicketsStore() {
throw new Error('Not authenticated');
}
const response = await fetch(`${API_URL}/v1/tickets/${ticketId}/attachments/${attachmentId}/download`, {
const response = await fetch(`/api/v1/tickets/${ticketId}/attachments/${attachmentId}/download`, {
method: 'GET',
headers: {
'Authorization': `Bearer ${authState.token}`,