Refactor API routes: migrate invoices and company endpoints to new structure and enhance error handling

This commit is contained in:
AlexeerCT
2025-12-29 13:15:00 -06:00
parent 8d0a895c8d
commit cb00e5cd16
4 changed files with 2 additions and 2 deletions

View File

@@ -23,7 +23,7 @@ export const load: PageLoad = async ({ params, url, parent }) => {
if (params.id === 'new') {
try {
// Llamar a la ruta de servidor que ya existe
const response = await fetch(`/api/invoices/reference-data`);
const response = await fetch(`/api-sveltekit/invoices/reference-data`);
if (!response.ok) {
console.error('Error loading reference data:', response.status);
@@ -98,7 +98,7 @@ export const load: PageLoad = async ({ params, url, parent }) => {
}
try {
const response = await fetch(`/api/invoices/${invoiceId}/edit-data`);
const response = await fetch(`/api-sveltekit/invoices/${invoiceId}/edit-data`);
if (!response.ok) {
throw error(response.status, 'Error al cargar la factura');