Skip to content

[5주차/엘리] 워크북 제출합니다.#50

Open
seohyeon0219 wants to merge 6 commits intoUMC-Inha:엘리/mainfrom
seohyeon0219:엘리/main

Hidden character warning

The head ref may contain hidden characters: "\uc5d8\ub9ac/main"
Open

[5주차/엘리] 워크북 제출합니다.#50
seohyeon0219 wants to merge 6 commits intoUMC-Inha:엘리/mainfrom
seohyeon0219:엘리/main

Conversation

@seohyeon0219
Copy link
Copy Markdown

@seohyeon0219 seohyeon0219 commented Apr 29, 2026

✅ 워크북 체크리스트

  • 모든 핵심 키워드 정리를 마쳤나요?
  • 핵심 키워드에 대해 완벽히 이해하셨나요?
  • 이론 학습 이후 직접 실습을 해보는 시간을 가졌나요?
  • 미션을 수행하셨나요?
  • 미션을 기록하셨나요?

✅ 컨벤션 체크리스트

  • 디렉토리 구조 컨벤션을 잘 지켰나요?
  • pr 제목을 컨벤션에 맞게 작성하였나요?
  • pr에 해당되는 이슈를 연결하였나요?(중요)
  • 적절한 라벨을 설정하였나요?
  • 파트장에게 code review를 요청하기 위해 reviewer를 등록하였나요?
  • 닉네임/main 브랜치의 최신 상태를 반영하고 있는지 확인했나요?(매우 중요!)

📌 주안점

@seohyeon0219 seohyeon0219 self-assigned this May 1, 2026
Comment thread mission/Chapter03/movie/src/lib/api.ts Outdated
Comment thread mission/Chapter03/movie/src/lib/api.ts
Comment on lines +53 to +67
try {
setServerError('')
const response = await api.post<{ name: string; accessToken: string; refreshToken: string }>(
'/v1/auth/signup',
{ name: data.nickname, email: savedEmail, password: savedPassword },
)
setToken({
accessToken: response.data.accessToken,
refreshToken: response.data.refreshToken,
name: response.data.name,
})
navigate('/')
} catch {
setServerError('회원가입에 실패했습니다. 다시 시도해주세요.')
}
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

catch에서 에러 객체를 무시하고 있습니다. 서버 응답 에러 메세지를 활용하면 좋을 것 같아요!

// 현재
} catch {
  setServerError('회원가입에 실패했습니다. 다시 시도...')
}

// 개선
} catch (error) {
  const message = axios.isAxiosError(error)
    ? error.response?.data?.message
    : undefined
  setServerError(message ?? '회원가입에 실패했습니다. 다시 시도해주세요.')
}

setServerError('')를 try 안에서 하면, 이전 에러가 잠깐 보일 수 있어서 submit 핸들러 최상단으로 올리는 게 낫습니다!

const handleSignupComplete = nicknameForm.handleSubmit(async (data) => {
  setServerError('') // ← try 바깥으로
  try {
    ...
  }
})

Copy link
Copy Markdown
Collaborator

@qkrdmsthff qkrdmsthff left a comment

Choose a reason for hiding this comment

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

LGTM 엘리 이번 주차도 화이팅입니다!

Comment thread mission/Chapter03/movie/src/lib/api.ts Outdated
return api(originalRequest)
} catch {
localStorage.removeItem('token')
window.location.href = '/login'
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

엘리 ~ 코드를 너무 깔끔하게 잘 짜주셔서 드릴 코드 리뷰가 없네요...!
그나마 추가해 보자면,

현재 SPA 의 장점을 무시하고 window.location.href 를 사용해서 페이지를 이동하고 있습니다! react-route-dom 의 useNavigate 훅을 사용해 보는 것을 권장합니다!

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.

5 participants