[Fix] 사용자 부서 변경 기본값이 현재 부서와 다름 - #259
Conversation
selectedUserId만 저장하고 현재 부서는 별도로 기억하지 않아, 부서 select가 항상 목록 첫 옵션(개발팀)으로 기본 선택되던 문제를 고친다. 사용자 선택 시 현재 departmentId를 함께 저장해 select에 반영하고, 변경 전후 부서가 같거나 미선택이면 제출을 막는다. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
|
Warning Review limit reached
Next review available in: 10 minutes Limit details: You’ve used the included review currently available. You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. How can I continue?Wait for the limit to reset, then comment An organization admin can change what happens after included review limits in Billing. How do review limits work?CodeRabbit enforces per-developer PR review limits within each organization. For paid Pro and Pro+ reviews, CodeRabbit uses a developer's included PR review attempts over the past 7 days to set the current hourly allowance. At typical activity levels, the full plan allowance applies. Higher sustained activity can lower the allowance until earlier attempts leave the 7-day window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
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 |
📌 Description
사용자·역할 화면에서 "역할 관리" 버튼으로 사용자를 선택해도 선택된 사용자의 현재 부서가 상태로 저장되지 않았다. 부서 변경 select에
value/defaultValue가 없어 항상 부서 목록의 첫 번째 옵션(개발팀)이 기본 선택됐고, 관리자가 값을 확인하지 않고 제출하면 의도치 않게 부서가 바뀌는 문제였다.currentDepartmentId(선택 시점 baseline) /selectedDepartmentId(드롭다운 현재 값) 상태를 추가하고, 사용자 선택을selectUser()헬퍼로 통일해 현재 부서를 함께 저장한다. select는 이 값을 그대로 반영하고, 현재 부서와 같거나 미선택이면 제출 버튼을 비활성화한다. 직접 사용자 ID를 타이핑해 입력한 경우엔 현재 부서를 알 수 없으므로 플레이스홀더로 비워 강제 선택하게 한다.closes #254
✅ To-do
selectedDepartmentId상태 추가departmentId를 함께 저장📒 기타
백엔드
PATCH /admin/users/{id}/department는 변경 없음.eslint,tsc --noEmit,npm run build통과