mirror of
https://git.v0id.ovh/n3wt-innov/n3wt-school.git
synced 2026-01-29 07:53:23 +00:00
refactor: Partie FRONT / School
This commit is contained in:
@ -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}
|
||||
|
||||
Reference in New Issue
Block a user