fix(admin): 대학교 인증 승인 버튼 — 실제 인증 상태 조회 + 실제 에러 메시지 표시 - #47
Conversation
- v2 사용자 상세 응답에 인증 상태(verifiedAt)가 없어 모든 유저가
'미인증'으로 표시되고 승인 버튼이 노출되던 문제 수정
- 학생증 대기 목록 + 대학 소속 목록(verifiedAt)으로 실제 상태 판정:
인증됨 / 학생증 제출(승인 가능) / 학생증 미제출(승인 불가, 버튼 숨김)
- AdminApiError 가 v2 에러 형식 {error:{message}} 의 실제 메시지를
읽지 못해 'Request failed: 400' 만 보이던 문제 수정
- '이미 인증된 사용자' 에러 시 UI 상태를 즉시 인증됨으로 반영
Co-Authored-By: Newbie Smart <smartnewb2@gmail.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 74e54fda18
ℹ️ 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".
| page: 1, | ||
| limit: 100, |
There was a problem hiding this comment.
인증 대기 API는 totalPages를 반환하는 페이지네이션 목록인데 여기서는 첫 100건만 조회합니다. 같은 이름·대학의 검색 결과가 100건을 넘거나 이름 필터가 없는 사용자라면 후속 페이지의 실제 신청자를 놓치며, 이후 소속 정보의 verifiedAt: null을 근거로 unverified를 반환해 학생증을 제출한 사용자를 "학생증 미제출"로 표시하고 승인 버튼까지 숨깁니다. userId로 직접 조회하거나 totalPages까지 검색해야 합니다.
Useful? React with 👍 / 👎.
학생증 미제출 유저에게도 인증 승인 버튼 표시 + '학생증 미제출' 힌트 유지. Co-Authored-By: Newbie Smart <smartnewb2@gmail.com>
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: df34e18a0c
ℹ️ 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".
| 학생증 미제출 | ||
| </Typography> | ||
| )} | ||
| {uniVerificationStatus !== 'loading' && ( |
| }; | ||
| }, [open, userDetail?.id, userDetail?.name, isUniversityVerified, currentUniversityName]); | ||
|
|
||
| const showUniversityVerified = isUniversityVerified || uniVerificationStatus === 'verified'; |
There was a problem hiding this comment.
v2 상세 응답에 인증 필드가 없는 검증 완료 사용자는 여기서만 uniVerificationStatus === 'verified'를 반영하므로, 본문에는 "인증됨"이 표시되지만 UniversityTransferModal에는 여전히 원래의 isUniversityVerified(false)가 전달되고 성공 처리에서도 authentication: false가 기록됩니다. 이 사용자가 변경을 열면 같은 화면에서 "미인증"으로 표시되고 변경 직후 로컬 상태도 미인증으로 되돌아가므로, 새로 계산한 상태를 모달과 성공 처리에도 일관되게 사용해야 합니다.
Useful? React with 👍 / 👎.



Summary
사용자 상세 모달의 "인증 승인" 버튼이 모든 유저에게 표시되고, 실패 시 "Request failed: 400" 이라는 무의미한 에러만 보이던 문제를 수정합니다.
원인
GET /admin/v2/users/:id응답에 인증 상태(verifiedAt,certificateImageUrl)가 없어isUniversityVerified가 항상 false → 대학 등록 유저 전원에게 "미인증" + 승인 버튼 표시.학생증 이미지가 업로드되지 않은 사용자입니다./이미 인증된 사용자입니다.)을 반환하지만, 프론트는 v2 에러 형식{error: {code, message}}의message를 읽지 못해Request failed: 400만 노출.수정
shared/lib/http/admin-fetch.ts:extractErrorMessage()—body.error.message우선 추출로 모든 어드민 액션에 실제 한글 에러 메시지 노출.userAppearance.getUniversityVerificationStatus()추가 — 학생증 대기 목록 + 대학 소속 목록(verifiedAt)으로 실제 상태 판정:verified→ "✓ 인증됨" 뱃지 (버튼 없음)pending(학생증 제출, 미인증) → "미인증" + 인증 승인 버튼unverified(학생증 미제출) → "미인증" + "학생증 미제출" 힌트 + 인증 승인 버튼 (관리자 수동 승인 — sometimes-api 허용 패치와 짝)handleUniversityApproval:getAdminErrorMessage로 실제 에러 표시 + "이미 인증된" 에러 시 UI 즉시 인증됨으로 반영.관련 변경: sometimes-api
devin/1790172666-univ-approve-no-cert— 학생증 이미지가 없는 사용자의 승인 차단 400을 제거(관리자 수동 승인 허용). 미제출 유저의 승인이 실제로 성공하려면 해당 백엔드 배포가 필요합니다.확인
verifiedAt: null+ 학생증 미제출 → (기존 백엔드) approve 호출 시400 학생증 이미지가 업로드되지 않은 사용자입니다.확인.pnpm typecheck:admin-v2통과,eslint에러 0,pnpm test:admin123개 통과.Link to Devin session: https://app.devin.ai/sessions/b864a162fa6f465587fda88ac2571cf9
Open in Devin Desktop: https://app.devin.ai/desktop/session/b864a162fa6f465587fda88ac2571cf9?variant=devin
Requested by: @Smartnewb