change some files
This commit is contained in:
@@ -2,7 +2,7 @@ import React, { useState } from "react";
|
||||
import { Box, TextField, Typography, Button, Container } from "@mui/material";
|
||||
import { useApplicantLogin } from "@/hooks/auth.hook";
|
||||
import { toast } from "sonner";
|
||||
import { handleAxiosError } from "@/core/utils";
|
||||
import { handleAxiosError, handleLoginRedirect } from "@/core/utils";
|
||||
import { useRouter } from "next/navigation";
|
||||
|
||||
export default function LoginLayout() {
|
||||
@@ -13,11 +13,12 @@ export default function LoginLayout() {
|
||||
const handleSubmit = async (e: React.FormEvent) => {
|
||||
e.preventDefault();
|
||||
try {
|
||||
await mutateAsync(nationalId);
|
||||
const response = await mutateAsync(nationalId);
|
||||
console.log("response => ",response)
|
||||
if (isPending) {
|
||||
toast.loading("در حال انتقال به فرم استخدامي");
|
||||
}
|
||||
router.push("/form");
|
||||
handleLoginRedirect(router, response);
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
toast.error(handleAxiosError(error));
|
||||
|
||||
Reference in New Issue
Block a user