Skip to content

🐛 지원 대학 수정 모달에서 정원 외 필드가 채워지지 않던 문제 수정 - #620

Merged
whqtker merged 1 commit into
mainfrom
feat/817-admin-univ-apply-edit-detail-fetch
Aug 2, 2026
Merged

🐛 지원 대학 수정 모달에서 정원 외 필드가 채워지지 않던 문제 수정#620
whqtker merged 1 commit into
mainfrom
feat/817-admin-univ-apply-edit-detail-fetch

Conversation

@whqtker

@whqtker whqtker commented Aug 1, 2026

Copy link
Copy Markdown
Member

요약

  • 어드민 지원 대학 관리에서 수정 버튼을 누르면 정원(studentCapacity)만 채워지고 나머지 필드(학기 요건, 언어 상세, 학점 요건 등)는 값이 있어도 항상 비어 보이던 문제 수정
  • 원인: 수정 모달을 열 때 검색 목록(GET /univ-apply-infos/search/text) 응답 데이터로 폼을 채웠는데, 이 응답에는 목록용 미리보기 필드만 있고 정원 외 상세 필드는 애초에 포함되어 있지 않았음
  • 백엔드 #817에서 추가한 GET /admin/univ-apply-infos/{id} 단건 조회 API를 호출해 상세 정보를 받아온 뒤 폼을 채우도록 수정
  • 상세 조회 중에는 "불러오는 중..." 표시, 실패 시 에러 메시지 표시
  • 리페치로 쿼리 데이터 참조가 바뀌어도(예: 창 포커스 복귀) 수정 중인 값을 덮어쓰지 않도록, 폼 동기화 effect는 조회된 항목의 id가 바뀔 때만 실행되게 처리

의존성

  • 백엔드 PR(#817, GET /admin/univ-apply-infos/{id}) 배포 이후 정상 동작. 아직 배포 전이라면 상세 조회가 404로 실패하고 모달에 에러 메시지가 표시됨

테스트 플랜

  • pnpm --filter admin typecheck, lint:check 통과 (커밋 시 CI parity 훅으로 확인)
  • pnpm --filter admin build 성공 (push 시 CI parity 훅으로 확인)
  • 실제 화면에서 수정 모달을 열어 필드가 채워지는지 확인 — 백엔드 배포 후 진행 필요

Co-Authored-By: Claude Sonnet 5 noreply@anthropic.com
https://claude.ai/code/session_01EwpgqdNTrn8dGDr7g7WnYg

수정 모달을 열 때 검색 목록(search/text) 응답의 값으로 폼을 채웠는데,
그 응답에는 정원(studentCapacity) 외 필드가 애초에 포함되어 있지
않아 나머지 항목은 값이 있어도 항상 비어 보였다.

GET /admin/univ-apply-infos/{id} 단건 조회 API(백엔드 #817)를
호출해 상세 정보를 받아온 뒤 폼을 채우도록 수정했다.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EwpgqdNTrn8dGDr7g7WnYg
@whqtker
whqtker requested review from manNomi and wibaek as code owners August 1, 2026 16:48
@vercel

vercel Bot commented Aug 1, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
solid-connect-university-web Ready Ready Preview Aug 1, 2026 4:49pm
solid-connect-web-admin Ready Ready Preview Aug 1, 2026 4:49pm
1 Skipped Deployment
Project Deployment Actions Updated (UTC)
solid-connection-web Skipped Skipped Aug 1, 2026 4:49pm

@coderabbitai

coderabbitai Bot commented Aug 1, 2026

Copy link
Copy Markdown

Review Change Stack

Walkthrough

선택한 대학 지원 정보의 상세 조회 API를 추가했습니다. 수정 모달은 조회 상태에 따라 로딩, 오류 또는 전체 수정 폼을 표시합니다. 상세 데이터 ID가 변경될 때만 수정 폼과 추가 정보 JSON을 초기화합니다.

Estimated code review effort: 3 (Moderate) | ~20 minutes

  1. 상세 조회 API 추가

    • adminApi.getUnivApplyInfo(id)가 ID별 상세 데이터를 조회합니다.
  2. 수정 모달 조회 및 폼 처리 변경

    • 수정 대상 ID로 상세 데이터를 조회합니다.
    • 조회 완료 후 전체 수정 폼을 채웁니다.
    • 로딩 및 오류 상태를 표시합니다.

Suggested reviewers: wibaek, mannomi, enunsnv

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed 지원 대학 수정 모달의 정원 외 필드 미표시 문제와 단건 상세 조회를 통한 수정 내용을 명확하게 설명합니다.
Description check ✅ Passed 문제 원인, 변경 내용, 백엔드 의존성, 테스트 계획을 구체적으로 설명했으며 템플릿의 일부 섹션은 별도 제목 없이 포함했습니다.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/817-admin-univ-apply-edit-detail-fetch

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: af1b715527

ℹ️ 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".

detailsForAccommodation: detail.detailsForAccommodation,
});
setEditExtraInfoText(detail.extraInfo ? JSON.stringify(detail.extraInfo, null, 2) : "");
}, [editDetailQuery.data?.id]);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Refresh cached details when reopening the same record

After an administrator saves a record and reopens it, React Query immediately returns the cached pre-update detail and then refetches it because the detail query was neither updated nor invalidated on mutation success. The effect runs for the cached value when the modal reopens, but the network response has the same id, so this dependency suppresses the second run and leaves the form showing stale values; saving again can silently overwrite the previous update. Update/remove the detail cache after mutation or key form initialization to each modal session while still protecting active edits from focus refetches.

Useful? React with 👍 / 👎.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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/tabs/UnivApplyInfoManageTab.tsx`:
- Around line 107-127: 수정 성공 처리에서 검색 쿼리뿐 아니라 상세 쿼리도 무효화하도록 업데이트하세요. 수정 대상인
`["univ-apply-infos", "detail", editingId]`를 `invalidateQueries`에 포함해 재조회 시 최신
데이터를 사용하고, `editDetailQuery.data?.id`가 동일해도 최신 값으로 폼이 갱신되도록 하세요. 동일 항목을 수정한 뒤 다시
열었을 때 최신 값이 표시되는 검증도 추가하세요.
🪄 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 Plus

Run ID: 1d93cf0e-541e-4c8e-8008-ab0bb36813bb

📥 Commits

Reviewing files that changed from the base of the PR and between 8f2c130 and af1b715.

📒 Files selected for processing (2)
  • apps/admin/src/components/features/univ-apply-infos/tabs/UnivApplyInfoManageTab.tsx
  • apps/admin/src/lib/api/admin.ts

Comment on lines +107 to +127
const editDetailQuery = useQuery({
queryKey: ["univ-apply-infos", "detail", editingId],
queryFn: () => adminApi.getUnivApplyInfo(editingId as number),
enabled: editingId !== undefined,
});

// biome-ignore lint/correctness/useExhaustiveDependencies: 조회된 상세 정보의 id가 바뀔 때만 폼을 채워야 하며, 리페치로 데이터 참조가 바뀌어도 수정 중인 값을 덮어쓰면 안 됨
useEffect(() => {
if (!editDetailQuery.data) return;
const detail = editDetailQuery.data;
setEditForm({
studentCapacity: detail.studentCapacity,
semesterAvailableForDispatch: detail.semesterAvailableForDispatch,
semesterRequirement: detail.semesterRequirement,
detailsForLanguage: detail.detailsForLanguage,
gpaRequirement: detail.gpaRequirement,
gpaRequirementCriteria: detail.gpaRequirementCriteria,
detailsForAccommodation: detail.detailsForAccommodation,
});
setEditExtraInfoText(detail.extraInfo ? JSON.stringify(detail.extraInfo, null, 2) : "");
}, [editDetailQuery.data?.id]);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

FILE='apps/admin/src/components/features/univ-apply-infos/tabs/UnivApplyInfoManageTab.tsx'

ast-grep outline "$FILE" --items all
rg -n -C 8 'editDetailQuery|updateMutation|invalidateQueries|setEditModal' "$FILE"

Repository: solid-connection/solid-connect-web

Length of output: 8823


🏁 Script executed:

#!/bin/bash
set -euo pipefail

FILE='apps/admin/src/types/admin.ts'
# Locate adminApi definition even if filename differs.
ast-grep outline apps/admin/src --items all 2>/dev/null | rg -n 'adminApi|getUnivApplyInfo|updateUnivApplyInfo' || true

# Print relevant sections from candidate files.
fd -t f 'admin.*\.(ts|tsx)$' apps/admin/src | while read -r f; do
  echo "===== $f ====="
  rg -n -C 6 'getUnivApplyInfo|updateUnivApplyInfo|univ-apply-infos|queryKey' "$f" || true
done

# Print exact relevant source ranges from the tab.
sed -n '1,230p' "$FILE" 2>/dev/null || true
sed -n '129,143p' apps/admin/src/components/features/univ-apply-infos/tabs/UnivApplyInfoManageTab.tsx

Repository: solid-connection/solid-connect-web

Length of output: 4003


수정 성공 후 상세 쿼리도 무효화하세요.

수정 성공 후 ["univ-apply-infos", "search"]invalidateQueries합니다. 같은 항목을 다시 열면 이전 상세 캐시가 폼에 적용될 수 있고, 동일한 detail.id 재조회는 useEffect를 다시 실행하지 않아 최신 값이 표시되지 않습니다.

수정 예시
- onSuccess: async () => {
-   await queryClient.invalidateQueries({
-     queryKey: ["univ-apply-infos", "search"],
-   });
+ onSuccess: async (_response, { id }) => {
+   await Promise.all([
+     queryClient.invalidateQueries({
+       queryKey: ["univ-apply-infos", "search"],
+     }),
+     queryClient.invalidateQueries({
+       queryKey: ["univ-apply-infos", "detail", id],
+     }),
+   ]);
    setEditModal({ open: false });
    toast.success("지원 대학 정보를 수정했습니다.");
  },

동일 항목을 수정한 뒤 다시 열어 최신 값이 표시되는 검증도 추가하세요.

🤖 Prompt for 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.

In
`@apps/admin/src/components/features/univ-apply-infos/tabs/UnivApplyInfoManageTab.tsx`
around lines 107 - 127, 수정 성공 처리에서 검색 쿼리뿐 아니라 상세 쿼리도 무효화하도록 업데이트하세요. 수정 대상인
`["univ-apply-infos", "detail", editingId]`를 `invalidateQueries`에 포함해 재조회 시 최신
데이터를 사용하고, `editDetailQuery.data?.id`가 동일해도 최신 값으로 폼이 갱신되도록 하세요. 동일 항목을 수정한 뒤 다시
열었을 때 최신 값이 표시되는 검증도 추가하세요.

@whqtker
whqtker merged commit 46f86c0 into main Aug 2, 2026
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant