feature/rbac y perfiles implementados
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
// src/api/pedimentoDocuments.ts
|
||||
import { fetchWithAuth } from '../fetchWithAuth';
|
||||
import { extractApiError } from './apiError';
|
||||
|
||||
export interface PedimentoDocument {
|
||||
id: string;
|
||||
@@ -47,6 +48,6 @@ export async function fetchPedimentoDocuments(
|
||||
`${API_URL}/record/documents/?${params.toString()}`
|
||||
);
|
||||
|
||||
if (!res.ok) throw new Error('No autorizado o error en la petición');
|
||||
if (!res.ok) throw new Error(await extractApiError(res));
|
||||
return res.json();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user