fix: validation by query param
This commit is contained in:
@@ -5,6 +5,7 @@ import { useRegister } from '../../_hooks/use-register';
|
|||||||
import { ControlledInputField } from '@imphnen-frontend-service/ui/organisms';
|
import { ControlledInputField } from '@imphnen-frontend-service/ui/organisms';
|
||||||
import { UseFormReturn } from 'react-hook-form';
|
import { UseFormReturn } from 'react-hook-form';
|
||||||
import { TRegisterRequest } from '@imphnen-frontend-service/service';
|
import { TRegisterRequest } from '@imphnen-frontend-service/service';
|
||||||
|
import { useEffect } from 'react';
|
||||||
|
|
||||||
interface IModalFormRegisterProps {
|
interface IModalFormRegisterProps {
|
||||||
isOpen: boolean;
|
isOpen: boolean;
|
||||||
@@ -25,6 +26,12 @@ const ModalFormRegister = ({ isOpen, onClose }: IModalFormRegisterProps) => {
|
|||||||
minValue: 1,
|
minValue: 1,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
if (!isStepOneValid && currentStep === 2) {
|
||||||
|
prevStep();
|
||||||
|
}
|
||||||
|
}, [isStepOneValid, currentStep, prevStep]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Modal
|
<Modal
|
||||||
className="py-[45px] min-w-[400px] lg:min-w-[455px] px-7"
|
className="py-[45px] min-w-[400px] lg:min-w-[455px] px-7"
|
||||||
|
|||||||
Reference in New Issue
Block a user