diff --git a/FrontAdmin/src/API/Montos.ts b/FrontAdmin/src/API/Montos.ts index 0fefd09..6a9e29a 100644 --- a/FrontAdmin/src/API/Montos.ts +++ b/FrontAdmin/src/API/Montos.ts @@ -6,7 +6,7 @@ export const FetchMontos = async (offset: number, limit: number) => { const token = Cookies.get('tokennn'); const response = await fetch( - `${URL}/pagos/compromisos/?offset=${offset}&limit=${limit}`, + `${URL}/compromisos/`, { method: 'GET', headers: { @@ -63,7 +63,7 @@ export const loadPDF = async (id :string,file: File) => { const formData = new FormData(); formData.append('archivo_pdf', file); - const response = await fetch(`${URL}/pagos/compromisos/${id}/`, { + const response = await fetch(`${URL}/compromisos/${id}/`, { method: 'PATCH', headers: { Authorization: `Bearer ${token}`, diff --git a/FrontAdmin/src/Context.tsx b/FrontAdmin/src/Context.tsx index e6721d8..9230cd5 100644 --- a/FrontAdmin/src/Context.tsx +++ b/FrontAdmin/src/Context.tsx @@ -13,10 +13,11 @@ interface AuthContextType { const AuthContext = createContext(undefined); const AuthProvider = ({ children }: { children: ReactNode }) => { + const [rolUser, setRolUser] = useState([]); const [isAuthenticated, setIsAuthenticated] = useState( - !Cookies.get('tokennn') ? false : true + (!Cookies.get('tokennn') ) ? false : true ); - const [rolUser, setRolUser] = useState([]); + let refreshTimeout: NodeJS.Timeout; const refreshToken = async () => { diff --git a/FrontAdmin/src/components/Pages/Configuracion/Montos/NewInterfaz.tsx b/FrontAdmin/src/components/Pages/Configuracion/Montos/NewInterfaz.tsx index 0841b08..8bac0f5 100644 --- a/FrontAdmin/src/components/Pages/Configuracion/Montos/NewInterfaz.tsx +++ b/FrontAdmin/src/components/Pages/Configuracion/Montos/NewInterfaz.tsx @@ -59,7 +59,7 @@ const NewInterfaz = ({ compromisos }: CardCargaProps) => { const handleViewPdf = async (url: string) => { try { - const token = Cookies.get('access_token'); + const token = Cookies.get('tokennn'); const response = await fetch(url, { headers: { Authorization: `Bearer ${token}`,