Refactor API routes: migrate invoices and company endpoints to new structure and enhance error handling
This commit is contained in:
@@ -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');
|
||||
|
||||
Reference in New Issue
Block a user