-
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-90-Pesta-a-Pagos
Signed-off-by: Yoel Marain <[email protected]>
- Loading branch information
Showing
16 changed files
with
545 additions
and
58 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,75 @@ | ||
import Cookies from 'js-cookie'; | ||
|
||
export const getInhabilitaciones = async (limit: number, offset: number) => { | ||
try { | ||
const token = Cookies.get('tokennn'); | ||
const response = await fetch(`http://localhost:8000/api/alumnos/inhabilitados?limit=${limit}&offset=${offset}` , { | ||
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 getAlumnosaInhabilitar = async () => { | ||
try { | ||
const token = Cookies.get('tokennn'); | ||
const response = await fetch(`http://localhost:8000/api/alumnos/alumnos-a-inhabilitar` , { | ||
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 inhabilitarAlumno = async (legajo: number) => { | ||
try { | ||
const token = Cookies.get('tokennn'); | ||
const response = await fetch(`http://localhost:8000/api/alumnos/alumno-a-inhabilitar/${legajo}/` , { | ||
method: 'DELETE', | ||
headers: { | ||
'Content-Type': 'application/json', | ||
Authorization: `Bearer ${token}`, | ||
}, | ||
}); | ||
if (response.ok) { | ||
if (response.status === 204) { | ||
// No hay contenido en la respuesta | ||
return {}; | ||
} else { | ||
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); | ||
} | ||
|
||
}; | ||
|
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
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
11 changes: 11 additions & 0 deletions
11
FrontAdmin/src/components/Pages/Estadisticas/AlumnosBaja.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import React from 'react'; | ||
import TablaAlumnos from './SubPages/TablaAlumnos'; | ||
import { FetchFirmantes } from '../../../API/AlumnosCompromisoPago'; | ||
|
||
const AlumnosBaja = () => { | ||
return ( | ||
<TablaAlumnos fetchFunction={FetchFirmantes} title="Alumnos que se dieron de baja" /> | ||
); | ||
}; | ||
|
||
export default AlumnosBaja; |
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
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
Oops, something went wrong.