fix: ajustement du handlePhoneChange [#41]

This commit is contained in:
Luc SORIGNET
2025-04-28 10:37:57 +02:00
parent 5ea3cbb079
commit 31fdc612b1
2 changed files with 13 additions and 3 deletions

View File

@ -63,7 +63,10 @@ export default function ResponsableInputFields({
};
const addGuardian = () => {
setGuardians([...guardians, { id: Date.now(), name: '', email: '' }]);
setGuardians([
...guardians,
{ id: Date.now(), name: '', email: '', phone: '' },
]);
};
const deleteGuardian = (index) => {
@ -148,7 +151,7 @@ export default function ResponsableInputFields({
label="phone"
value={item.phone}
onChange={(event) => {
onGuardiansChange(item.id, 'phone', event);
onGuardiansChange(item.id, 'phone', event.target.value);
}}
required
errorMsg={getError(index, 'phone')}