Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: 방 생성 중복 요청 해결 #135

Merged
merged 1 commit into from
Feb 1, 2025

Conversation

dongho108
Copy link
Contributor

🔗 연관된 이슈 번호

#134

✨ 어떤 기능을 개발했나요?

아래 문제를 해결하였습니다.

  1. mutate(room) 호출
  2. mutate 호출로 인해 isSuccess가 변경됨
  3. isSuccess 변경으로 인해 useEffect가 다시 실행됨
  4. 다시 mutate(room) 호출

✅ 어떻게 해결했나요?

  1. API 호출 로직을 handleCreateRoom이라는 별도의 함수로 분리했습니다.
  2. useEffect를 두 개로 분리하여 API 호출과 상태 처리를 분리했습니다:
    • 첫 번째 useEffect는 API 호출 결과(isError, isSuccess)에 따른 처리만 담당
    • handleCreateRoom 함수는 실제 API 호출만 담당
  3. handleClickCompleteButton 함수에서 상태 업데이트 후 handleCreateRoom을 호출하도록 변경했습니다.

📌 어떤 부분에 집중하여 리뷰해야 할까요?

  • 다른 부분에 영향이 가는지 확인해주세요.

❗️이 부분은 주의해 주세요! (Option)

🗂️ 참고자료 (Option)

🚀 결과 (Option)


@corinthionia corinthionia merged commit 2a5aff0 into develop Feb 1, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants