Conversation
|
Warning
|
| Cohort / File(s) | Summary |
|---|---|
API: updateApplicantDetail 시그니처 변경frontend/src/apis/application/updateApplicantDetail.ts |
updateApplicantDetail의 4번째 파라미터명을 appId → applicantId로 변경하고 요청 URL에서 해당 식별자를 사용하도록 수정. 기타 로직 불변. |
Hook: useUpdateApplicant 시그니처/호출부 정합frontend/src/hooks/queries/applicants/useUpdateApplicant.ts |
훅 시그니처의 두번째 파라미터명을 appId → applicantId로 변경하고, updateApplicantDetail 호출에 applicantId를 전달하도록 수정. 동작 불변. |
UI: ApplicantDetailPage 조회 방식 단순화 및 상태 목록 변경frontend/src/pages/AdminPage/tabs/ApplicantsTab/ApplicantDetailPage/ApplicantDetailPage.tsx |
useMemo 제거 후 findIndex와 인덱스 접근으로 applicantIndex/applicant 계산으로 변경. AVAILABLE_STATUSES에서 SCREENING 제거 및 일부 상태 목록 조정. 색상 매핑에서 SCREENING 관련 분기 제거. |
Types: ApplicationStatus 축소frontend/src/types/applicants.ts |
ApplicationStatus에서 다수 상태(DRAFT, SCREENING, SCREENING_PASSED, SCREENING_FAILED, INTERVIEW_IN_PROGRESS, INTERVIEW_PASSED, INTERVIEW_FAILED, OFFERED, CANCELED_BY_APPLICANT 등)를 제거. 남은 값: SUBMITTED, INTERVIEW_SCHEDULED, ACCEPTED, DECLINED. |
Utils: 상태 그룹 매핑 단순화frontend/src/utils/mapStatusToGroup.ts |
상태별 그룹 매핑을 간소화(예: SUBMITTED, INTERVIEW_SCHEDULED, ACCEPTED만 각각 매핑)하고 DECLINED를 명시적으로 추가. 기본 폴백은 동일. |
Estimated code review effort
🎯 3 (Moderate) | ⏱️ ~20 minutes
Possibly related issues
- [refactor] FE 코드 리팩토링 #671: ApplicantDetailPage의 useMemo 제거 및 ApplicationStatus 축소 요구와 직접적으로 일치합니다.
- [refactor] BE 코드 리팩토링 #672: 불필요한 application status 제거 작업과 enum 축소가 대응됩니다.
Possibly related PRs
- [feature] 지원서의 정보를 수정하는 즉시 서버와 동기화된다. #670: 동일 API/훅(updateApplicantDetail / useUpdateApplicant) 시그니처 영역을 다루며 파라미터명 변경과 직접 연관됩니다.
- [feautre] 지원서 관리 API #622: 백엔드의 applicant 업데이트 엔드포인트와 프런트엔드의 PUT 호출(경로/식별자 사용)이 계약상 연계됩니다.
- [feature] 지원자의 상태와 메모를 변경한다. #651:
updateApplicantDetail사용부 수정과 관련된 PR로 호출 시그니처 변경과 연계됩니다.
Suggested reviewers
- Zepelown
- oesnuj
- PororoAndFriends
- suhyun113
Tip
🔌 Remote MCP (Model Context Protocol) integration is now available!
Pro plan users can now connect to remote MCP servers from the Integrations page. Connect with popular remote MCPs such as Notion and Linear to add more context to your reviews and chats.
✨ Finishing Touches
- 📝 Generate Docstrings
🧪 Generate unit tests
- Create PR with unit tests
- Post copyable unit tests in a comment
- Commit unit tests in branch
refactor/671-fe-refactor
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.
🪧 Tips
Chat
There are 3 ways to chat with CodeRabbit:
- Review comments: Directly reply to a review comment made by CodeRabbit. Example:
I pushed a fix in commit <commit_id>, please review it.Open a follow-up GitHub issue for this discussion.
- Files and specific lines of code (under the "Files changed" tab): Tag
@coderabbitaiin a new review comment at the desired location with your query. - PR comments: Tag
@coderabbitaiin a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:@coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.@coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
Support
Need help? Create a ticket on our support page for assistance with any issues or questions.
CodeRabbit Commands (Invoked using PR/Issue comments)
Type @coderabbitai help to get the list of available commands.
Other keywords and placeholders
- Add
@coderabbitai ignoreanywhere in the PR description to prevent this PR from being reviewed. - Add
@coderabbitai summaryto generate the high-level summary at a specific location in the PR description. - Add
@coderabbitaianywhere in the PR title to generate the title automatically.
Status, Documentation and Community
- Visit our Status Page to check the current availability of CodeRabbit.
- Visit our Documentation for detailed information on how to use CodeRabbit.
- Join our Discord Community to get help, request features, and share feedback.
- Follow us on X/Twitter for updates and announcements.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
seongwon030
left a comment
There was a problem hiding this comment.
지원자 불합 상태 추가해놓을게용 고생하셨습니다!
| status: ApplicationStatus, | ||
| clubId: string, | ||
| appId: string, | ||
| applicantId: string, |
| const { applicant, applicantIndex } = useMemo(() => { | ||
| const index = |
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Nitpick comments (5)
frontend/src/utils/mapStatusToGroup.ts (2)
11-12: 레이블 용어 통일 여부 확인(‘불합’ vs ‘불합격’)사용자 노출 텍스트로 보입니다. 기존 화면/문서에서 ‘불합격’을 썼다면 통일해 주세요.
3-16: switch 대신 상수 맵 + exhaustiveness 체크로 리팩토링 제안상태 축소가 끝났으니 객체 맵으로 단순화하면 가독성이 좋아지고, 새 상태 추가 시 컴파일 타임에 누락을 잡기 쉽습니다.
예시:
const STATUS_MAP: Record<ApplicationStatus, { status: ApplicationStatus; label: string }> = { [ApplicationStatus.SUBMITTED]: { status: ApplicationStatus.SUBMITTED, label: '서류검토' }, [ApplicationStatus.INTERVIEW_SCHEDULED]: { status: ApplicationStatus.INTERVIEW_SCHEDULED, label: '면접예정' }, [ApplicationStatus.ACCEPTED]: { status: ApplicationStatus.ACCEPTED, label: '합격' }, [ApplicationStatus.DECLINED]: { status: ApplicationStatus.DECLINED, label: '불합' }, }; const mapStatusToGroup = (status: ApplicationStatus) => STATUS_MAP[status];frontend/src/pages/AdminPage/tabs/ApplicantsTab/ApplicantDetailPage/ApplicantDetailPage.tsx (3)
19-22: AVAILABLE_STATUSES에서 DECLINED(불합) 제외 — 의도 확인 필요상태 enum에는 DECLINED가 남아 있고 mapStatusToGroup도 ‘불합’을 지원하지만, 선택 목록에서는 제외되어 있습니다. 관리자가 UI에서 불합 처리를 못 하게 하려는 의도인지 확인 부탁드립니다. 불합 선택이 필요하다면 아래처럼 추가하세요.
const AVAILABLE_STATUSES = [ ApplicationStatus.SUBMITTED, // 서류검토 (SUBMITTED 포함) ApplicationStatus.INTERVIEW_SCHEDULED, // 면접예정 ApplicationStatus.ACCEPTED, // 합격 + ApplicationStatus.DECLINED, // 불합 ] as const;참고: DECLINED 컬러가 필요하다면 getStatusColor에도 케이스를 추가해 주세요(예: '#FFECEC' 등 디자인 가이드에 맞춰).
47-49: useMemo 제거로 간결해졌지만, 파라미터 명은 applicantId로 정리 권장로직 자체는 단순·명료해져서 좋습니다. 다만 라우트 파라미터 이름이 questionId로 남아 있어, 이번 PR 목표(appId → applicantId)와 불일치합니다. 가독성과 유지보수를 위해 applicantId로 통일하는 편이 좋습니다.
- 제안: 라우트 파라미터, 훅 인자, 비교 로직 전반을 applicantId로 리네임
- 대량 데이터에서 findIndex O(n)이 부담될 수 있다면, applicants를 id→index 맵으로 보관(컨텍스트 수준)하거나 useMemo로 메모이제이션 고려
리네임 예시(파일 전반):
// 라우트 파라미터 const { applicantId } = useParams<{ applicantId: string }>(); // 훅 const { mutate: updateApplicant } = useUpdateApplicant(clubId!, applicantId!); // 조회 const applicantIndex = applicantsData?.applicants.findIndex((a) => a.id === applicantId) ?? -1; const applicant = applicantsData?.applicants[applicantIndex]; // 내비게이션 onChange={(e) => navigate(`/admin/applicants/${e.target.value}`)} navigate(`/admin/applicants/${previousData.id}`) navigate(`/admin/applicants/${nextData.id}`)
47-49: 디바운스 지연값(400) 매직 넘버 상수화 제안코드 전반의 의미 부여와 재사용을 위해 명명 상수로 추출해 주세요.
예시(파일 상단 혹은 핸들러 근처에 선언):
const UPDATE_DEBOUNCE_MS = 400;사용처:
debounce((memo, status) => { /* ... */ }, UPDATE_DEBOUNCE_MS)
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
💡 Knowledge Base configuration:
- MCP integration is disabled by default for public repositories
- Jira integration is disabled by default for public repositories
- Linear integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
📒 Files selected for processing (2)
frontend/src/pages/AdminPage/tabs/ApplicantsTab/ApplicantDetailPage/ApplicantDetailPage.tsx(2 hunks)frontend/src/utils/mapStatusToGroup.ts(1 hunks)
🧰 Additional context used
📓 Path-based instructions (2)
frontend/**/*.{ts,tsx}
📄 CodeRabbit Inference Engine (frontend/.cursorrules)
frontend/**/*.{ts,tsx}: Replace magic numbers with named constants for clarity.
Replace complex or nested ternary operators with if/else statements or IIFEs for readability.
Assign complex boolean conditions to named variables.
Use consistent return types for similar functions and hooks.
Avoid hidden side effects; functions should only perform actions implied by their signature (Single Responsibility Principle).
Use unique, descriptive names for custom wrappers and functions to avoid ambiguity.
Define constants near related logic or ensure names link them clearly.
Files:
frontend/src/utils/mapStatusToGroup.tsfrontend/src/pages/AdminPage/tabs/ApplicantsTab/ApplicantDetailPage/ApplicantDetailPage.tsx
frontend/**/*.tsx
📄 CodeRabbit Inference Engine (frontend/.cursorrules)
frontend/**/*.tsx: Abstract complex logic/interactions into dedicated components or higher-order components (HOCs).
Separate significantly different conditional UI/logic into distinct components.
Colocate simple, localized logic or use inline definitions to reduce context switching.
Choose field-level or form-level cohesion based on form requirements.
Break down broad state management into smaller, focused hooks or contexts.
Use component composition instead of props drilling.
Files:
frontend/src/pages/AdminPage/tabs/ApplicantsTab/ApplicantDetailPage/ApplicantDetailPage.tsx
🔇 Additional comments (3)
frontend/src/utils/mapStatusToGroup.ts (1)
11-12: DECLINED 매핑 추가 합리적입니다축소된 enum과 UI 흐름에 맞게 불합 처리 케이스를 명시해 둔 점 좋습니다.
frontend/src/pages/AdminPage/tabs/ApplicantsTab/ApplicantDetailPage/ApplicantDetailPage.tsx (2)
19-22: 레거시 상태 및 식별자 검증 완료
rg검색 결과, 제거 대상이 된ApplicationStatus멤버와appId/app_id식별자가 코드베이스에서 모두 발견되지 않았습니다.
상태 축소 및 식별자 리네이밍이 전체 FE에 일관되게 적용된 것으로 보입니다.
47-49: clubId!, questionId! 단언 사용 안전성 강화 필요useMutation에는
enabled옵션이 제공되지 않으므로,clubId나applicantId가undefined일 때에도mutationFn이 호출되어 잘못된 API 요청이 전송될 수 있습니다. 컴포넌트 혹은 훅 내부에서 ID 존재 여부를 반드시 검사하여,undefined인 경우 네트워크 요청을 no-op 처리하거나 호출 자체를 차단하도록 보호 로직을 추가해주세요.
- frontend/src/pages/AdminPage/tabs/ApplicantsTab/ApplicantDetailPage/ApplicantDetailPage.tsx (47–49):
clubId!,questionId!단언 대신if (!clubId || !questionId) return;식의 null/undefined 체크를 적용- src/hooks/queries/applicants/useUpdateApplicant.ts:
mutationFn실행 전에clubId,applicantId유효성 검사 후, 미정의 시 즉시 리턴하거나 dummy mutation 객체를 반환하도록 구현⛔ Skipped due to learnings
Learnt from: seongwon030 PR: Moadong/moadong#195 File: frontend/src/pages/AdminPage/AdminPage.tsx:7-7 Timestamp: 2025-03-19T05:18:07.818Z Learning: AdminPage.tsx에서 현재 하드코딩된 클럽 ID('67d2e3b9b15c136c6acbf20b')는 로그인 기능 구현 후 동적으로 가져오는 방식으로 수정될 예정입니다.
#️⃣연관된 이슈
appId -> applicantId
불필요한 status 제거
useMemo 삭제
📝작업 내용
중점적으로 리뷰받고 싶은 부분(선택)
논의하고 싶은 부분(선택)
🫡 참고사항
Summary by CodeRabbit
신기능
리팩터