From ecd48de2119c1751ee6c88a2d7dd2b47003761c6 Mon Sep 17 00:00:00 2001 From: Jean-Marie Place Date: Tue, 21 Nov 2023 17:20:49 +0100 Subject: [PATCH] wip --- app/templates/but/jury_export.j2 | 27 ++++++++++++++++++++------- 1 file changed, 20 insertions(+), 7 deletions(-) diff --git a/app/templates/but/jury_export.j2 b/app/templates/but/jury_export.j2 index 6f7fa5f72..01abd62c9 100644 --- a/app/templates/but/jury_export.j2 +++ b/app/templates/but/jury_export.j2 @@ -29,19 +29,32 @@ .then(r => { return r.json(); }) .then(json => { let etudiants = json; + promises_etud_semestres = [] + promises_semestres = [] etudiants.forEach((etudiant) => { let url =`/ScoDoc/{{dept}}/api/etudiant/nip/${etudiant.code_nip}/formsemestres`; console.log(url); - etudiant.formsemestres_id = []; - fetch(`/ScoDoc/{{dept}}/api/etudiant/nip/${etudiant.code_nip}/formsemestres`) + promises_etud_semestres.push( + fetch(url) + .then(r => { return r.json(); }) + .then(semestre => { + formsemestre_id = semestre.formsemestre_id; + + }) + ) +// etudiant.formsemestres_id = []; + fetch(url) .then(r => {return r.json; }) .then(json => { let forms = json; - forms.forEach((formsem) => { - if (formsem.is_apc) { - etudiant.formsemestres_id.push(formsem.formsemestre_id); - } - }); + console.log(etudiant.code_nip + " " + forms.formsemestre_id); +// forms.forEach((formsem) => { +// if (formsem.is_apc) { +// etudiant.formsemestres_id.push(formsem.formsemestre_id); +// if (formsem.formsemestre_id in_array()) { +// } +// } +// }); }); }); //let releve = document.querySelector("releve-but");