Minor fix

This commit is contained in:
Clayzxr
2025-01-21 16:32:00 +01:00
parent db6669901b
commit 661b59645b
2 changed files with 0 additions and 3 deletions
@@ -21,7 +21,6 @@ export default function ConsultStudents() {
useEffect(() => {
const fetchPromotionsAndStudents = async () => {
try {
// Récupérer toutes les promotions
const promoResponse = await fetch("/mobility/api/promotions");
if (!promoResponse.ok) {
throw new Error(`Error fetching promotions: ${promoResponse.statusText}`);
@@ -29,14 +28,12 @@ export default function ConsultStudents() {
const promos: Promotion[] = await promoResponse.json();
setPromotions(promos);
// Récupérer les étudiants
const studentsResponse = await fetch("/mobility/api/insert_students");
if (!studentsResponse.ok) {
throw new Error(`Error fetching students: ${studentsResponse.statusText}`);
}
const students: Student[] = await studentsResponse.json();
// Grouper les étudiants par promotionId
const grouped: Record<number, Student[]> = {};
for (const student of students) {
if (!grouped[student.promotionId]) {