Commit dea888ad authored by 우지원's avatar 우지원
Browse files

받는거 id로 수정

parent aa88e353
......@@ -18,7 +18,7 @@ function Chat(props) {
async function getLoginedUser() { //email로 db에서 찾아오기 ㅇㅇㅇㅇㅇ
const userid = localStorage.getItem('user')
const response = await axios.post(`/users/${userid}`, { 'email': userid })
const response = await axios.post(`/users/${userid}`, { '_id': userid })
setUsername(response.data.username)
}
useEffect(() => {
......
......@@ -28,7 +28,7 @@ function ProfilePage() {
async function getLoginedUser() { //email로 db에서 찾아오기 ㅇㅇㅇㅇㅇ
const userid = localStorage.getItem('user')
const response = await axios.post(`/users/${userid}`, { 'email': userid })
const response = await axios.post(`/users/${userid}`, { '_id': userid })
setUser(response.data)
}
......
......@@ -13,7 +13,7 @@ const INIT_USER = {
}
function SingUp() {
const [validated, setValidated] = useState(false);
//const [validated, setValidated] = useState(false);
const [user, setUser] = useState(INIT_USER)
const [error, setError] = useState('')
const [disabled, setDisabled] = useState(true)
......@@ -37,13 +37,13 @@ function SingUp() {
event.preventDefault();
//빈문자열 입력 시 오류 문자 출력
const form = event.currentTarget;
if (form.checkValidity() === false) {
event.preventDefault();
event.stopPropagation();
//event.stopPropagation() : 이벤트 캡쳐링과 버블링에 있어 현재 이벤트 이후의 전파를 막습니다.
}
setValidated(true);
//const form = event.currentTarget;
//if (form.checkValidity() === false) {
// event.preventDefault();
// event.stopPropagation();
// //event.stopPropagation() : 이벤트 캡쳐링과 버블링에 있어 현재 이벤트 이후의 전파를 막습니다.
//}
//setValidated(true);
// console.log(user)
try {
......@@ -82,7 +82,7 @@ function SingUp() {
<>
<Menu />
<Form noValidate validated={validated} onSubmit={handleSubmit} className='vh-100 flex-column align-items-center justify-content-center mt-2'>
<Form onSubmit={handleSubmit} className='vh-100 flex-column align-items-center justify-content-center mt-2'>
<Container className="d-flex justify-content-center">
<div className="mt-5 p-5 shadow w-75">
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment