-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'dev' into TUP-81-Posible-paginado-en-tabla-alumnos-divi…
…dir-alumnos-en-activos-e-historico
- Loading branch information
Showing
3 changed files
with
87 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
import Cookies from 'js-cookie'; | ||
|
||
const fetchAlumnosCompromiso = async (url: string): Promise<any> => { | ||
try { | ||
const token = Cookies.get('tokennn'); | ||
|
||
const response = await fetch(url, { | ||
method: 'GET', | ||
headers: { | ||
'Content-Type': 'application/json', | ||
Authorization: `Bearer ${token}`, | ||
}, | ||
}); | ||
|
||
if (response.ok) { | ||
const data = await response.json(); | ||
return data; | ||
} else { | ||
throw new Error('Error en la respuesta del servidor'); | ||
} | ||
} catch (error) { | ||
throw new Error('Network error: ' + error); | ||
} | ||
}; | ||
|
||
export const FetchFirmantes = async (): Promise<any> => { | ||
const url = 'http://localhost:8000/api/firmantes/alumnos-firmaron-ultimo-compromiso/'; | ||
return fetchAlumnosCompromiso(url); | ||
}; | ||
|
||
export const FetchNoFirmantes = async (): Promise<any> => { | ||
const url = 'http://localhost:8000/api/firmantes/alumnos-no-firmaron-ultimo-compromiso/'; | ||
return fetchAlumnosCompromiso(url); | ||
}; |
80 changes: 46 additions & 34 deletions
80
FrontAdmin/src/components/Pages/Estadisticas/SubPages/AlumnosConCompromiso.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters