login register updated
This commit is contained in:
@@ -8,6 +8,7 @@ import { useMutation } from '@tanstack/react-query';
|
||||
import { apiRequest } from '@/shared/request/apiRequest';
|
||||
import { links } from '@/shared/request/links';
|
||||
import { toast } from 'react-toastify';
|
||||
import { useRouter } from '@/shared/config/i18n/navigation';
|
||||
|
||||
interface RegisterData {
|
||||
name: string;
|
||||
@@ -20,6 +21,7 @@ export function useRegisterForm() {
|
||||
useRegisterZustand();
|
||||
const [errors, setErrors] = useState<RegisterErrors>({});
|
||||
const [success, setSuccess] = useState(false);
|
||||
const route = useRouter();
|
||||
const toggleRegisterModal = useRegisterModal(
|
||||
(state) => state.toggleRegisterModal,
|
||||
);
|
||||
@@ -33,6 +35,7 @@ export function useRegisterForm() {
|
||||
toggleRegisterModal();
|
||||
setSuccess(true);
|
||||
toast.success("Ro'yxatdan o'tish muvaffaqiyatli!");
|
||||
route.push('/plagat');
|
||||
},
|
||||
onError: (err) => {
|
||||
// toggleLoginModal();
|
||||
|
||||
Reference in New Issue
Block a user