refactor: Partie FRONT / School

This commit is contained in:
N3WT DE COMPET
2025-01-12 16:45:41 +01:00
parent 41aa9d55d3
commit 24352efad3
25 changed files with 217 additions and 186 deletions

View File

@ -6,14 +6,18 @@ export const useTeacherForm = () => useContext(TeacherFormContext);
export const TeacherFormProvider = ({ children, initialTeacher }) => {
const [formData, setFormData] = useState(() => ({
nom: initialTeacher.nom || '',
prenom: initialTeacher.prenom || '',
mail: initialTeacher.mail || '',
specialites_ids: initialTeacher.specialites_ids || [],
profilAssocie_id: initialTeacher.profilAssocie_id || '',
droit: initialTeacher.droit || 0
last_name: initialTeacher.last_name || '',
first_name: initialTeacher.first_name || '',
email: initialTeacher.email || '',
specialities: initialTeacher.specialities || [],
associated_profile: initialTeacher.associated_profile || '',
droit: {
label: initialTeacher.droit?.label || '',
id: initialTeacher.droit?.id || 0
}
}));
return (
<TeacherFormContext.Provider value={{ formData, setFormData }}>
{children}