mirror of
https://git.v0id.ovh/n3wt-innov/n3wt-school.git
synced 2026-01-29 07:53:23 +00:00
feat: Ajout de l'option d'envoi automatique [#1]
This commit is contained in:
@ -183,7 +183,7 @@ export default function Page({ params: { locale } }) {
|
||||
useEffect(() => {
|
||||
fetchClasses();
|
||||
fetchStudents();
|
||||
}, []);
|
||||
}, [fichesInscriptionsDataEnCours]);
|
||||
|
||||
useEffect(() => {
|
||||
const fetchDataAndSetState = () => {
|
||||
@ -302,9 +302,17 @@ export default function Page({ params: { locale } }) {
|
||||
})
|
||||
.then(response => response.json())
|
||||
.then(data => {
|
||||
console.log('Success:', data);
|
||||
setFichesInscriptionsDataEnCours(prevState => [...prevState, data]);
|
||||
setTotalPending(totalPending+1);
|
||||
console.log('Success:', data);
|
||||
setFichesInscriptionsDataEnCours(prevState => {
|
||||
if (prevState && prevState.length > 0) {
|
||||
return [...prevState, data];
|
||||
}
|
||||
return prevState;
|
||||
});
|
||||
setTotalPending(totalPending+1);
|
||||
if (updatedData.autoMail) {
|
||||
sendConfirmFicheInscription(data.eleve.id, updatedData.eleveNom, updatedData.elevePrenom);
|
||||
}
|
||||
})
|
||||
.catch((error) => {
|
||||
console.error('Error:', error);
|
||||
@ -344,7 +352,7 @@ export default function Page({ params: { locale } }) {
|
||||
responsables: [
|
||||
{
|
||||
mail: updatedData.responsableEmail,
|
||||
//telephone: telephoneResponsable,
|
||||
telephone: updatedData.responsableTel,
|
||||
profilAssocie: idProfil // Association entre le reponsable de l'élève et le profil créé par défaut précédemment
|
||||
}
|
||||
],
|
||||
@ -363,9 +371,17 @@ export default function Page({ params: { locale } }) {
|
||||
})
|
||||
.then(response => response.json())
|
||||
.then(data => {
|
||||
console.log('Success:', data);
|
||||
setFichesInscriptionsDataEnCours(prevState => [...prevState, data]);
|
||||
setTotalPending(totalPending+1);
|
||||
console.log('Success:', data);
|
||||
setFichesInscriptionsDataEnCours(prevState => {
|
||||
if (prevState && prevState.length > 0) {
|
||||
return [...prevState, data];
|
||||
}
|
||||
return prevState;
|
||||
});
|
||||
setTotalPending(totalPending+1);
|
||||
if (updatedData.autoMail) {
|
||||
sendConfirmFicheInscription(data.eleve.id, updatedData.eleveNom, updatedData.elevePrenom);
|
||||
}
|
||||
})
|
||||
.catch((error) => {
|
||||
console.error('Error:', error);
|
||||
@ -623,9 +639,10 @@ const columnsSubscribed = [
|
||||
isOpen={isOpen}
|
||||
setIsOpen={setIsOpen}
|
||||
title={"Création d'un nouveau dossier d'inscription"}
|
||||
size='sm:w-1/4'
|
||||
ContentComponent={() => (
|
||||
<InscriptionForm eleves={eleves}
|
||||
onSubmit={createDI}
|
||||
<InscriptionForm eleves={eleves}
|
||||
onSubmit={createDI}
|
||||
/>
|
||||
)}
|
||||
/>
|
||||
|
||||
Reference in New Issue
Block a user