diff --git a/src/components/students/StudentsFormModal.tsx b/src/components/students/StudentsFormModal.tsx index 0167607..f4da5c9 100644 --- a/src/components/students/StudentsFormModal.tsx +++ b/src/components/students/StudentsFormModal.tsx @@ -29,7 +29,6 @@ interface IStudentsFormModalState { } class StudentsFormModal extends React.Component { - constructor(props: StudentFormModalProps) { super(props); @@ -45,16 +44,11 @@ class StudentsFormModal extends React.Component s.id === studentSchoolId) - ? studentSchoolId - : undefined; + schoolId = this.props.schools.some((s) => s.id === studentSchoolId) ? studentSchoolId : undefined; } let educationId; @@ -96,24 +90,13 @@ class StudentsFormModal extends React.Component {getFieldDecorator("firstName", { validateTrigger: this.state.formValidateTrigger, - rules: [ - { required: true, message: "Voornaam mag niet leeg zijn" }, - ], - })( - , - )} + rules: [{ required: true, message: "Voornaam mag niet leeg zijn" }], + })()} {getFieldDecorator("lastName", { validateTrigger: this.state.formValidateTrigger, - })( - , - )} + })()} {getFieldDecorator("schoolId", { @@ -128,7 +111,7 @@ class StudentsFormModal extends React.Component {this.props.schools.map(this.renderSchoolSelectOption)} - , + )} @@ -144,7 +127,7 @@ class StudentsFormModal extends React.Component {this.props.educations.map(this.renderEducationSelectOption)} - , + )} @@ -152,7 +135,9 @@ class StudentsFormModal extends React.ComponentStudent is bevestigd door de school, + + Student is bevestigd door de school + )} @@ -163,13 +148,17 @@ class StudentsFormModal extends React.Component{school.name} + + {school.name} + ); } private renderEducationSelectOption(education: Education): React.ReactNode { return ( - {education.name} + + {education.name} + ); } @@ -203,10 +192,11 @@ class StudentsFormModal extends React.Component("schoolId")], values[nameof("educationId")], this.props.studentToEdit !== undefined ? this.props.studentToEdit.isPlanned : false, - this.props.studentToEdit !== undefined ? this.props.studentToEdit.internship : undefined, + this.props.studentToEdit !== undefined ? this.props.studentToEdit.internship : undefined ); - this.props.submitStudent(student) + this.props + .submitStudent(student) .then(() => { this.handleClose(); })