-
Notifications
You must be signed in to change notification settings - Fork 1
[Y26W2-430] fix(web): 여행시작일이 과거인 경우 validation 허용하도록 수정 #204
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
base: main
Are you sure you want to change the base?
Conversation
|
🎫 관련 Jira 티켓 🔗: Y26W2-430 📝 Jira 티켓 정보:
|
개요날짜 범위 선택기의 검증 로직이 단순화되었습니다. 시작 날짜가 오늘 이상이어야 한다는 조건이 제거되었으며, 새로운 검증은 두 경계 날짜의 존재 여부와 종료 날짜가 시작 날짜보다 이전이 아님만 확인합니다. 변경 사항
예상 코드 리뷰 난이도🎯 2 (단순) | ⏱️ ~8분
시
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
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.
Actionable comments posted: 0
🧹 Nitpick comments (1)
apps/web/src/domains/dashboard/components/base-form-field/index.tsx (1)
52-61: 과거 시작일 허용 로직은 요구사항과 일치합니다
dateRange의validate가from/to존재 여부와to >= from만 확인하도록 바뀌어서,
- 과거 시작일은 허용하면서도
- 미입력 상태나 종료일이 시작일보다 빠른 잘못된 구간은 막는
동작으로 정리된 점 좋습니다. PR 설명에 적힌 “과거 시작일 허용” 요구사항과도 일치합니다.
추가로, 이 블록은 항상 boolean만 반환하므로, (그리고
value가 혹시undefined일 수도 있다는 점을 고려하면) 아래처럼 한 줄 boolean 표현으로 정리해 두면 가독성과 안정성이 조금 더 좋아질 것 같습니다(선택 사항입니다).- rules={{ - validate: (value) => { - const today = new Date(); - today.setHours(0, 0, 0, 0); - - if (!value.from || !value.to || value.to < value.from) { - return false; - } - - return true; - }, - }} + rules={{ + validate: (value) => + !!value && !!value.from && !!value.to && value.to >= value.from, + }}이렇게 하면
value가 초기값으로undefined인 경우에도 런타임 에러 없이 “유효하지 않은 값”으로만 처리됩니다.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
apps/web/src/domains/dashboard/components/base-form-field/index.tsx(1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
- GitHub Check: build
- GitHub Check: deploy
|
This pull request (commit
|
✨ 변경 사항
➡️ 캘린더에서 이미 오늘 이전 날짜 선택이 disabled 처리되어 있어,
추가적인 form validation 로직 없이도 사용성에 영향을 주지 않는 것 같아요.
✅ 체크리스트
📸 스크린샷 (선택)
default.mp4
📝 기타 참고 사항
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.