fix(api-url): todas las apps usan || en vez de ?? para VITE_API_URL

- 11 archivos corregidos: agente-ia, alta-clientes, cobranza, cotizador,
  dashboards, mi-dia, landing (auth.ts, api.ts, mi-dia.ts, reportes.ts,
  push.ts, notas.ts, recordatorios.ts, reporte-mi-tablero.ts)
- ?? solo cubre null/undefined, || cubre string vacío
- 7 apps reconstruidas
This commit is contained in:
2026-09-10 21:26:54 +00:00
parent 913bdff0d1
commit 98889bbf6a
11 changed files with 11 additions and 11 deletions

View File

@@ -2,7 +2,7 @@
import type { ResumenMiDia } from '../lib/mi-dia'
import { conAuth, manejar401 } from './auth'
const API_URL = import.meta.env.VITE_API_URL ?? '/api'
const API_URL = import.meta.env.VITE_API_URL || '/api'
async function fetchJson<T>(path: string, init: RequestInit = {}): Promise<T> {
const res = await fetch(`${API_URL}${path}`, conAuth(init))

View File

@@ -1,6 +1,6 @@
import { conAuth, manejar401 } from './auth'
const API_URL = import.meta.env.VITE_API_URL ?? '/api'
const API_URL = import.meta.env.VITE_API_URL || '/api'
export interface NotaApartado {
id: string

View File

@@ -1,6 +1,6 @@
import { conAuth, manejar401 } from './auth'
const API_URL = import.meta.env.VITE_API_URL ?? '/api'
const API_URL = import.meta.env.VITE_API_URL || '/api'
/** Convierte la VAPID public key (base64url) a Uint8Array para PushManager */
function urlBase64ToUint8Array(base64String: string): Uint8Array {

View File

@@ -1,6 +1,6 @@
import { conAuth, manejar401 } from './auth'
const API_URL = import.meta.env.VITE_API_URL ?? '/api'
const API_URL = import.meta.env.VITE_API_URL || '/api'
export interface Recordatorio {
id: string

View File

@@ -1,6 +1,6 @@
import { conAuth, manejar401 } from './auth'
const API_URL = import.meta.env.VITE_API_URL ?? '/api'
const API_URL = import.meta.env.VITE_API_URL || '/api'
async function fetchJson<T>(path: string, init: RequestInit = {}): Promise<T> {
const res = await fetch(`${API_URL}${path}`, conAuth(init))