Compare commits

..

1 Commits

Author SHA1 Message Date
a69e934075 fixed handleSubmit missing input 2025-10-31 12:51:22 +01:00

View File

@@ -265,7 +265,7 @@ const useEmployeeForm = (mode: 'create' | 'edit', employee?: Employee) => {
// Determine if can work alone based on employee type // Determine if can work alone based on employee type
const canWorkAlone = employeeType === 'manager' || const canWorkAlone = employeeType === 'manager' ||
(employeeType === 'personell' && !formData.isTrainee); (employeeType === 'personell' && !formData.isTrainee);
// Reset isTrainee if not personell // Reset isTrainee if not personell
const isTrainee = employeeType === 'personell' ? formData.isTrainee : false; const isTrainee = employeeType === 'personell' ? formData.isTrainee : false;
@@ -343,7 +343,8 @@ const useEmployeeForm = (mode: 'create' | 'edit', employee?: Employee) => {
await executeWithValidation(() => await executeWithValidation(() =>
employeeService.changePassword(employee.id, { employeeService.changePassword(employee.id, {
currentPassword: '', currentPassword: '',
newPassword: passwordForm.newPassword newPassword: passwordForm.newPassword,
confirmPassword: passwordForm.confirmPassword
}) })
); );
} }
@@ -365,8 +366,8 @@ const useEmployeeForm = (mode: 'create' | 'edit', employee?: Employee) => {
switch (stepIndex) { switch (stepIndex) {
case 0: case 0:
return !!formData.firstname.trim() && return !!formData.firstname.trim() &&
!!formData.lastname.trim(); !!formData.lastname.trim();
// REMOVE: (mode === 'edit' || formData.password.length >= 6) // REMOVE: (mode === 'edit' || formData.password.length >= 6)
case 1: case 1:
return !!formData.employeeType; return !!formData.employeeType;
case 2: case 2:
@@ -711,7 +712,7 @@ const Step2Content: React.FC<StepContentProps> = ({
{contractTypeOptions.map(contract => { {contractTypeOptions.map(contract => {
const isFlexibleDisabled = contract.value === 'flexible' && formData.employeeType === 'personell'; const isFlexibleDisabled = contract.value === 'flexible' && formData.employeeType === 'personell';
const isSmallLargeDisabled = (contract.value === 'small' || contract.value === 'large') && const isSmallLargeDisabled = (contract.value === 'small' || contract.value === 'large') &&
(formData.employeeType === 'manager' || formData.employeeType === 'apprentice'); (formData.employeeType === 'manager' || formData.employeeType === 'apprentice');
const isDisabled = isFlexibleDisabled || isSmallLargeDisabled; const isDisabled = isFlexibleDisabled || isSmallLargeDisabled;
return ( return (
@@ -867,8 +868,8 @@ const Step3Content: React.FC<StepContentProps> = ({
{formData.employeeType === 'manager' {formData.employeeType === 'manager'
? 'Chefs sind automatisch als eigenständig markiert.' ? 'Chefs sind automatisch als eigenständig markiert.'
: formData.employeeType === 'personell' && formData.isTrainee : formData.employeeType === 'personell' && formData.isTrainee
? 'Auszubildende können nicht als eigenständig markiert werden.' ? '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.' : 'Dieser Mitarbeiter kann komplexe Aufgaben eigenständig lösen und benötigt keine ständige Betreuung.'
} }
</div> </div>
</div> </div>