Skip to content

Commit

Permalink
Merge pull request #70 from KUIT-Space/feat#api
Browse files Browse the repository at this point in the history
api: github.io proxy ์•ˆ๋˜๋Š” ๋ฌธ์ œ๋กœ back์— ๋ฐ”๋กœ ์ „๋‹ฌํ•˜๋„๋ก ๋ณ€๊ฒฝ
  • Loading branch information
Turtle-Hwan authored Aug 15, 2024
2 parents ab854e7 + d811f4e commit 341eadc
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/apis/LoginApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
};
4 changes: 3 additions & 1 deletion src/pages/LoginPage/LoginPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
Expand Down

0 comments on commit 341eadc

Please sign in to comment.