CFE-6 Fixed any bugs

This commit is contained in:
AmirHossein Mahmoodi
2023-10-02 16:09:05 +03:30
parent 3e36e3fedd
commit 7e2c18ca6c
4 changed files with 9 additions and 6 deletions

1
.gitignore vendored
View File

@@ -28,6 +28,7 @@ cypress/videos
cypress/screenshots
.next
.env.local
.env.test
.env
.idea
package-lock.json

View File

@@ -3,6 +3,8 @@ import {rest} from "msw";
export const handler = [rest.get(GET_USER_ROUTE, (req, res, ctx) => {
return res(ctx.json({
id: 10
data: {
id: 10
}
}))
})]

View File

@@ -10,7 +10,7 @@ import useRequest from "@/lib/app/hooks/useRequest";
import useUser from "@/lib/app/hooks/useUser";
import {useTranslations} from "next-intl";
const LoginExpertComponent = () =>{
const LoginExpertComponent = () => {
const t = useTranslations();
const requestServer = useRequest()
const {setToken} = useUser(); // pass token to set token
@@ -24,7 +24,7 @@ const LoginExpertComponent = () =>{
notification: {show: false}
}
}).then((response) => {
setToken(response.data.token)
setToken(response.data.data.token)
}).catch(() => {
props.setSubmitting(false)
})
@@ -38,7 +38,7 @@ const LoginExpertComponent = () =>{
password: Yup.string().required(t("LoginPage.password_error_message_required")),
});
return(
return (
<Container maxWidth="sm">
<Paper elevation={0}>
<Formik

View File

@@ -1,7 +1,7 @@
const BASE_URL = process.env.NEXT_PUBLIC_BASE_URL;
//login
export const GET_USER_TOKEN = BASE_URL + "/dashboard/login";
export const GET_USER_TOKEN = BASE_URL + "/api/auth/login";
//end login
//change password
@@ -9,5 +9,5 @@ export const SET_USER_PASSWORD = BASE_URL + "/dashboard/profile/change_password"
//end change password
//user data
export const GET_USER_ROUTE = BASE_URL + "/dashboard/profile/info";
export const GET_USER_ROUTE = BASE_URL + "/api/profile/info";
//user data