diff --git a/src/apis/LoginApi.ts b/src/apis/LoginApi.ts index 9f83b7f..94ff011 100644 --- a/src/apis/LoginApi.ts +++ b/src/apis/LoginApi.ts @@ -26,5 +26,5 @@ export const loginApi = async (email: string, password: string) => { }; const requestOptions = createRequestOptionsJSON("POST", JSON.stringify(body)); - return await fetchLoginApi("/api/user/login", requestOptions); + return await fetchLoginApi(`${import.meta.env.VITE_API_BACK_URL}/user/login`, requestOptions); }; diff --git a/src/pages/LoginPage/LoginPage.tsx b/src/pages/LoginPage/LoginPage.tsx index 30d890d..ce4619c 100644 --- a/src/pages/LoginPage/LoginPage.tsx +++ b/src/pages/LoginPage/LoginPage.tsx @@ -29,7 +29,9 @@ const LoginPage = () => { }, [id, password]); const handleLogin = () => { - loginApi(id, password).then(res => res.status === "OK" ? navigate("/") : alert("login error: " + res.message)); + loginApi(id, password).then((res) => + res.status === "OK" ? navigate("/") : alert("login error: " + res.message), + ); }; return (