fix: Modification d'un guardian sans changer d'adresse mail (même

profil)
This commit is contained in:
N3WT DE COMPET
2025-05-20 17:43:34 +02:00
parent 05136035ab
commit 95b449ddfd

View File

@ -409,7 +409,6 @@ export default function CreateSubscriptionPage() {
},
last_name: formDataRef.current.guardianLastName,
first_name: formDataRef.current.guardianFirstName,
birth_date: formDataRef.current.guardianBirthDate,
phone: formDataRef.current.guardianPhone,
},
];
@ -418,7 +417,19 @@ export default function CreateSubscriptionPage() {
logger.debug('Cas 4 : Profil existant avec le même email', {
existingProfile,
});
return [];
return [
{
profile_role_data: {
establishment: selectedEstablishmentId,
role_type: 2,
is_active: true,
profile: formDataRef.current.existingProfileId,
},
last_name: formDataRef.current.guardianLastName,
first_name: formDataRef.current.guardianFirstName,
phone: formDataRef.current.guardianPhone,
},
];
}
} else {
// Cas 1 : Profil inexistant