Skip to content

[fix] 클럽 지원서 조회 시 오류 해결 및 Spinner 적용 및 예외 메시지 개선#505

Merged
oesnuj merged 1 commit intodevelop-fefrom
feature/#498-connect-application-api-MOA-38
Jun 6, 2025
Merged

[fix] 클럽 지원서 조회 시 오류 해결 및 Spinner 적용 및 예외 메시지 개선#505
oesnuj merged 1 commit intodevelop-fefrom
feature/#498-connect-application-api-MOA-38

Conversation

@oesnuj
Copy link
Member

@oesnuj oesnuj commented Jun 6, 2025

#️⃣연관된 이슈

#498

📝작업 내용

이번 PR에서 작업한 내용을 간략히 설명해주세요(이미지/동영상 첨부 가능)

  • useAnswers();훅이 return문보다 뒤에서 호출되어 React 훅 규칙을 위반한 문제가 있었고, 이를 뒤로 이동시켜 해결했습니다
    image

  • 클럽 상세 정보(clubDetail) 또는 지원서 데이터(formData)가 없을 때 null 참조로 인한 오류 방지

  • 로딩 시 "로딩 중..." 텍스트를 Spinner 컴포넌트로 교체하여 UX 개선

  • 지원서가 없거나 불러오지 못했을 경우 사용자에게 구체적인 예외 메시지를 안내

✅ 확인 사항

  • 데이터가 정상적으로 없을 경우에도 예외 메시지로 안내됨

  • 잘못된 접근 시 무한 스피너 발생하지 않음

  • 기존 정상 흐름(form 출력)은 그대로 유지됨

🫡 참고사항

https://velog.io/@sinf/Rendered-more-hooks-than-during-the-previous-render

Summary by CodeRabbit

  • 버그 수정
    • 로딩 중일 때 "로딩 중..." 텍스트 대신 스피너가 표시됩니다.
    • 오류 발생 시 통합된 오류 메시지가 보여집니다.
    • 신청서 정보를 불러오지 못할 경우 명확한 안내 메시지가 추가되었습니다.

@oesnuj oesnuj requested review from Copilot and seongwon030 June 6, 2025 04:45
@oesnuj oesnuj self-assigned this Jun 6, 2025
@oesnuj oesnuj added 💻 FE Frontend 🛠Fix 기능이 의도한 대로 동작하지 않는 버그를 수정 labels Jun 6, 2025
@netlify
Copy link

netlify bot commented Jun 6, 2025

Deploy Preview for moadong ready!

Name Link
🔨 Latest commit a30380e
🔍 Latest deploy log https://app.netlify.com/projects/moadong/deploys/6842727644ffa40008add1d9
😎 Deploy Preview https://deploy-preview-505--moadong.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
Lighthouse
Lighthouse
1 paths audited
Performance: 44
Accessibility: 87
Best Practices: 92
SEO: 92
PWA: -
View the detailed breakdown and full score reports

To edit notification comments on pull requests, go to your Netlify project configuration.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jun 6, 2025

Warning

.coderabbit.yaml has a parsing error

The CodeRabbit configuration file in this repository has a parsing error and default settings were used instead. Please fix the error(s) in the configuration file. You can initialize chat with CodeRabbit to get help with the configuration file.

💥 Parsing errors (1)
Validation error: Invalid regex pattern for base branch. Received: "**" at "reviews.auto_review.base_branches[0]"
⚙️ Configuration instructions
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Walkthrough

AnswerApplicationForm 컴포넌트의 로딩 및 에러 처리 로직이 리팩터링되었습니다. 기존의 텍스트 기반 로딩 표시 대신 Spinner 컴포넌트를 사용하며, 에러 및 데이터 미존재 상황에 대한 분기 처리가 명확하게 재구성되었습니다. clubId 파라미터 전달 방식도 개선되었습니다.

Changes

파일/경로 변경 요약
frontend/src/pages/AdminPage/application/answer/AnswerApplicationForm.tsx Spinner 컴포넌트 도입, clubId 전달 방식 수정, 로딩/에러 처리 분기 재구성

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant AnswerApplicationForm
    participant useGetClubDetail
    participant useGetApplication
    participant Spinner

    User->>AnswerApplicationForm: 페이지 접근
    AnswerApplicationForm->>useGetClubDetail: clubId로 동아리 정보 요청
    AnswerApplicationForm->>useGetApplication: clubId로 지원서 정보 요청
    alt 로딩 중
        AnswerApplicationForm->>Spinner: 로딩 표시
    else 에러 발생
        AnswerApplicationForm-->>User: "지원서 정보를 불러오는 중 오류가 발생했습니다." 메시지 표시
    else 데이터 미존재
        AnswerApplicationForm-->>User: "지원서 정보를 불러오지 못했습니다." 메시지 표시
    else 정상
        AnswerApplicationForm-->>User: 지원서 폼 렌더링
    end
Loading

Assessment against linked issues

Objective Addressed Explanation
지원서 폼 조회 API 연동, 에러/로딩/성공 상태 처리 (MOA-38)
지원서 최초 작성/수정 API 연동, 사용자/관리자 모드 분기, 질문 유형별 렌더링 및 상태 관리 (MOA-38) 해당 PR에서는 폼 조회 및 상태 처리만 다루고, 나머지 항목의 구현 여부는 코드에서 확인되지 않음

Assessment against linked issues: Out-of-scope changes

(해당 사항 없음)

Possibly related PRs

  • Moadong/moadong#490: 동일 컴포넌트의 로딩 및 에러 처리 로직 리팩터링과 직접적인 연관이 있습니다.
  • Moadong/moadong#493: AnswerApplicationForm.tsx에서 질문 렌더링 및 UI/상태 관리 개선 관련 변경이 있어, 본 PR과 UI/로직 측면에서 연관성이 높습니다.

Suggested reviewers

  • seongwon030

📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 8ecc61a and a30380e.

📒 Files selected for processing (1)
  • frontend/src/pages/AdminPage/application/answer/AnswerApplicationForm.tsx (1 hunks)
🧰 Additional context used
🧬 Code Graph Analysis (1)
frontend/src/pages/AdminPage/application/answer/AnswerApplicationForm.tsx (3)
frontend/src/hooks/queries/club/useGetClubDetail.ts (1)
  • useGetClubDetail (6-20)
frontend/src/hooks/queries/application/useGetApplication.ts (1)
  • useGetApplication (4-10)
frontend/src/hooks/useAnswers.ts (1)
  • useAnswers (4-33)
🔇 Additional comments (5)
frontend/src/pages/AdminPage/application/answer/AnswerApplicationForm.tsx (5)

11-11: Spinner 컴포넌트 import 추가 승인

UX 개선을 위한 Spinner 컴포넌트 import가 적절하게 추가되었습니다.


17-18: 훅 호출 방식 개선 승인

clubId를 직접 전달하도록 변경한 것이 좋습니다. 15번 라인에서 이미 clubId의 null 체크가 완료되었으므로 안전합니다.


22-22: 로딩 상태 UI 개선 승인

기존의 "로딩 중..." 텍스트를 Spinner 컴포넌트로 교체하여 사용자 경험이 개선되었습니다.


24-26: 통합된 에러 처리 로직 승인

useGetClubDetailuseGetApplication 훅의 에러를 통합하여 처리하는 방식이 깔끔하고 효율적입니다.


28-35: 데이터 존재 여부 확인 로직 승인

formDataclubDetail 모두의 존재 여부를 확인하여 사용자에게 명확한 메시지를 제공하는 로직이 잘 구현되었습니다. 이는 null reference 에러를 방지하고 사용자에게 적절한 피드백을 제공합니다.

✨ Finishing Touches
  • 📝 Generate Docstrings

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
🪧 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.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in 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 src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

Documentation and Community

  • 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.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR fixes the issue where the club application details were being retrieved in the wrong sequence by adjusting the hook call order, and improves user feedback by replacing the loading text with a Spinner and providing more descriptive error messages.

  • Resolves hook call ordering between useGetApplication and useGetClubDetail.
  • Replaces the plain loading text with a Spinner component for consistency.
  • Adds specific error messages for application data retrieval failures.
Comments suppressed due to low confidence (1)

frontend/src/pages/AdminPage/application/answer/AnswerApplicationForm.tsx:28

  • Consider clarifying the error messaging here to specify which data (application or club details) failed to load, so users receive more targeted guidance.
if (!formData || !clubDetail) {

Copy link
Member

@seongwon030 seongwon030 left a comment

Choose a reason for hiding this comment

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

로딩 처리 좋네요 !

@oesnuj oesnuj merged commit 16103f9 into develop-fe Jun 6, 2025
7 checks passed
@oesnuj oesnuj deleted the feature/#498-connect-application-api-MOA-38 branch July 28, 2025 06:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

💻 FE Frontend 🛠Fix 기능이 의도한 대로 동작하지 않는 버그를 수정

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

Comments