-
Notifications
You must be signed in to change notification settings - Fork 1
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
[리팩토링] 메뉴 추가 페이지 컴포넌트 분할 및 에러 분기 추가 #351
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
컴포넌트로 분리되니 훨씬 깔끔해졌네요.
아주 초반에 오너웹 작업을 했던 것 같은데 다시 보니 새롭군요...
궁금한 점 하나 남겼습니다.
수고많으셨습니다!
src/page/AddMenu/index.tsx
Outdated
if (addMenuError) { | ||
showToast('error', '메뉴 추가에 실패했습니다.'); | ||
} else { | ||
navigate('/owner'); | ||
} | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
위 부분에서 궁금한 점이 있습니다!
addMenuMutation 안에서 onSuccess와 함께
onError: () => { },
이런 방향으로 처리하는 방식은 어떤가요? mutationFn의 성공, 실패에 따른 처리가 한 곳에 있는 것이 좋지 않을까?라는 생각이 들어 남겨봅니다!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mutation에 onError 로 처리했습니다. 0a988a1
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
슈뢰딩거의 css는 아마 가격 추가 수정 로직 변경하면서 제가 삭제를 안 한것 같습니다..
src/page/AddMenu/index.tsx
Outdated
goMyShop(); | ||
|
||
const onClickMenuAddConfirmHandler = (e: React.MouseEvent<HTMLButtonElement>) => { | ||
e.preventDefault(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
mouse이벤트에 막아줘야할 기본적인 동작이 있나요?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
막아줘야할 부분이 딱히 없는 것으로 확인되어서 다시 제거하였습니다. 0a988a1
What is this PR? 🔍
Changes 📝
ScreenShot 📷
Test CheckList ✅
Precaution
✔️ Please check if the PR fulfills these requirements
develop
branch unconditionally?main
?yarn lint