refactor: 지원 대학 국가 코드 검증 개선#560
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
1 Skipped Deployment
|
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
Walkthrough이 PR은 대학 정보 import 기능에 국가 코드 기반 검증을 추가하는 변경입니다. 다음과 같이 진행됩니다:
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Suggested reviewers
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 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.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 886ad91a1c
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In
`@apps/admin/src/components/features/univ-apply-infos/UnivApplyInfosPageContent.tsx`:
- Around line 162-170: The validCountryCodes useMemo hook on line 162-170
creates an empty Set even when countriesQuery.data is undefined or null, which
causes validatePreviewRows on line 194 to incorrectly mark all country codes as
unregistered during loading or failed data fetches since an empty Set is still
truthy. Add a guard condition in the useMemo hook to only construct the
validCountryCodes Set when countriesQuery.data is actually available, and ensure
that when data is not ready, either avoid calling validatePreviewRows or pass
null/undefined instead of an empty Set to prevent false positive validation
errors.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
Run ID: 845fb089-5244-4b22-a9da-5b81da7217b1
📒 Files selected for processing (3)
apps/admin/src/components/features/univ-apply-infos/UnivApplyInfosPageContent.tsxapps/admin/src/components/features/univ-apply-infos/univApplyInfoValidation.test.tsapps/admin/src/components/features/univ-apply-infos/univApplyInfoValidation.ts
변경 사항
/admin/countries응답을 정규화해 등록된 국가 코드 Set을 만들고,universityCountryCode값이 목록에 없으면 미리보기 단계에서 오류로 표시합니다.배경
기존 프론트 검증은 국가 코드가 대문자 2글자인지만 확인해
ZZ처럼 실제 서버 마스터 데이터에 없는 코드도 통과할 수 있었습니다. 국가/권역 마스터 데이터를 서버에서 받을 수 있으므로, import 전 preview 검증도 서버 데이터 기준으로 맞췄습니다.검증
pnpm --filter @solid-connect/admin testpnpm --filter @solid-connect/admin lint:checkpnpm --filter @solid-connect/admin typecheck@solid-connect/admin ci:check,@solid-connect/admin build참고
v24.14.0이라 저장소 요구사항인22.x와 다르다는 pnpm 경고가 출력됐지만, 위 검증 명령은 모두 통과했습니다.