mirror of
https://github.com/donpat1to/Schichtenplaner.git
synced 2025-11-30 22:45:46 +01:00
fixed handleSubmit missing input
This commit is contained in:
@@ -265,7 +265,7 @@ const useEmployeeForm = (mode: 'create' | 'edit', employee?: Employee) => {
|
||||
|
||||
// Determine if can work alone based on employee type
|
||||
const canWorkAlone = employeeType === 'manager' ||
|
||||
(employeeType === 'personell' && !formData.isTrainee);
|
||||
(employeeType === 'personell' && !formData.isTrainee);
|
||||
|
||||
// Reset isTrainee if not personell
|
||||
const isTrainee = employeeType === 'personell' ? formData.isTrainee : false;
|
||||
@@ -343,7 +343,8 @@ const useEmployeeForm = (mode: 'create' | 'edit', employee?: Employee) => {
|
||||
await executeWithValidation(() =>
|
||||
employeeService.changePassword(employee.id, {
|
||||
currentPassword: '',
|
||||
newPassword: passwordForm.newPassword
|
||||
newPassword: passwordForm.newPassword,
|
||||
confirmPassword: passwordForm.confirmPassword
|
||||
})
|
||||
);
|
||||
}
|
||||
@@ -365,8 +366,8 @@ const useEmployeeForm = (mode: 'create' | 'edit', employee?: Employee) => {
|
||||
switch (stepIndex) {
|
||||
case 0:
|
||||
return !!formData.firstname.trim() &&
|
||||
!!formData.lastname.trim();
|
||||
// REMOVE: (mode === 'edit' || formData.password.length >= 6)
|
||||
!!formData.lastname.trim();
|
||||
// REMOVE: (mode === 'edit' || formData.password.length >= 6)
|
||||
case 1:
|
||||
return !!formData.employeeType;
|
||||
case 2:
|
||||
@@ -711,7 +712,7 @@ const Step2Content: React.FC<StepContentProps> = ({
|
||||
{contractTypeOptions.map(contract => {
|
||||
const isFlexibleDisabled = contract.value === 'flexible' && formData.employeeType === 'personell';
|
||||
const isSmallLargeDisabled = (contract.value === 'small' || contract.value === 'large') &&
|
||||
(formData.employeeType === 'manager' || formData.employeeType === 'apprentice');
|
||||
(formData.employeeType === 'manager' || formData.employeeType === 'apprentice');
|
||||
const isDisabled = isFlexibleDisabled || isSmallLargeDisabled;
|
||||
|
||||
return (
|
||||
@@ -867,8 +868,8 @@ const Step3Content: React.FC<StepContentProps> = ({
|
||||
{formData.employeeType === 'manager'
|
||||
? 'Chefs sind automatisch als eigenständig markiert.'
|
||||
: formData.employeeType === 'personell' && formData.isTrainee
|
||||
? 'Auszubildende können nicht als eigenständig markiert werden.'
|
||||
: 'Dieser Mitarbeiter kann komplexe Aufgaben eigenständig lösen und benötigt keine ständige Betreuung.'
|
||||
? 'Auszubildende können nicht als eigenständig markiert werden.'
|
||||
: 'Dieser Mitarbeiter kann komplexe Aufgaben eigenständig lösen und benötigt keine ständige Betreuung.'
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user