Skip to content

Conversation

yujiah-github
Copy link
Contributor

@yujiah-github yujiah-github commented Apr 28, 2022

  • 이메일 인증 api 추가
  • 개인정보 조회 api 추가
  • 개인정보 변경 api 추가

@yujiah-github yujiah-github added 🔨 Task 컴포넌트 단위 개발 📬 API api 통신 관련 labels Apr 28, 2022
@yujiah-github yujiah-github self-assigned this Apr 28, 2022
@yujiah-github yujiah-github linked an issue Apr 28, 2022 that may be closed by this pull request
6 tasks
Comment on lines 50 to 59
//이메일 중복 확인
export const getUserEmailCheck = async (email) => {
const { data } = await axios.get(`${baseUrl}/emailCheck?email=${email}`);
if(data === true){
alert('중복된 이메일입니다!')
}
else{
return data;
}
};
Copy link
Contributor

@eunnbi eunnbi Apr 28, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

이렇게 코드 짜셔도 좋지만 react queryuseQuery에서 query function은 api 요청해서 받은 data를 반환을 해야 해서 다른 함수들처럼 바로 data를 반환해야 할 거예요. if문 안 로직의 경우에는 useQuery에서 onSuccess를 이용하면 되서 로직을 함수 밖으로 옮기셔야 할 거 같아요!

Comment on lines 45 to 48
onSuccess: () => {
if(data === false){
return data;
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

onSuccessuseQuery 함수 인자로 들어가는 거라서 이렇게 작성하시면 에러가 날거예요. return data로 코드 수정해주세요!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

📬 API api 통신 관련 🔨 Task 컴포넌트 단위 개발

Projects

None yet

Development

Successfully merging this pull request may close these issues.

마이페이지 api 로직

2 participants