-
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.
feat: implement fetch for pending signatures and update student table
- Loading branch information
1 parent
fa5f2e3
commit fadd0b8
Showing
3 changed files
with
61 additions
and
8 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,30 @@ | ||
import Cookies from 'js-cookie'; | ||
|
||
export const FetchPendientesFirma = async () => { | ||
try { | ||
const token = Cookies.get('tokennn'); | ||
|
||
const response = await fetch( | ||
`http://localhost:8000/api/estadisticas/firmas_pendientes/`, | ||
{ | ||
method: 'GET', | ||
headers: { | ||
'Content-Type': 'application/json', | ||
Authorization: `Bearer ${token}`, | ||
}, | ||
} | ||
); | ||
|
||
if (response.ok) { | ||
const data = await response.json(); | ||
return { | ||
results: data.results, // Lista de resultados | ||
count: data.count, // Total de elementos | ||
}; | ||
} else { | ||
throw new Error('Error en la respuesta del servidor'); | ||
} | ||
} catch (error) { | ||
throw new Error('Network error: ' + error); | ||
} | ||
}; |
35 changes: 28 additions & 7 deletions
35
FrontAdmin/src/components/Pages/Estadisticas/SubPages/PendientesFirma.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