From 7a76db160e8f46f37a07ef4c06300e2e95ab4887 Mon Sep 17 00:00:00 2001 From: samuop <129475377+samuop@users.noreply.github.com> Date: Thu, 26 Sep 2024 21:19:37 -0300 Subject: [PATCH] . --- FrontAdmin/src/API/Montos.ts | 4 ++-- FrontAdmin/src/Context.tsx | 5 +++-- .../components/Pages/Configuracion/Montos/NewInterfaz.tsx | 2 +- 3 files changed, 6 insertions(+), 5 deletions(-) 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 2fc322c..163a52c 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}`,