Skip to content

인터페이스 수정#455

Merged
HA-SEUNG-JEONG merged 2 commits into
mainfrom
fix/review-modal-main
Mar 26, 2026
Merged

인터페이스 수정#455
HA-SEUNG-JEONG merged 2 commits into
mainfrom
fix/review-modal-main

Conversation

@HA-SEUNG-JEONG

@HA-SEUNG-JEONG HA-SEUNG-JEONG commented Mar 26, 2026

Copy link
Copy Markdown
Contributor

🌱 연관된 이슈

☘️ 작업 내용

  • 기존 'GROUP_STUDY' | 'MENTOR_STUDY' 타입인 studyType을 MemberStudyListRequest로 확장 수정

🍀 참고사항

스크린샷 (선택)

Summary by CodeRabbit

릴리스 노트

  • Chores

    • 디버그 콘솔 출력문 제거
  • Refactor

    • API 요청 타입과의 일관성을 위해 내부 타입 정렬

@HA-SEUNG-JEONG HA-SEUNG-JEONG self-assigned this Mar 26, 2026
@vercel

vercel Bot commented Mar 26, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
study-platform-client-dev Ready Ready Preview, Comment Mar 26, 2026 5:08pm

@coderabbitai

coderabbitai Bot commented Mar 26, 2026

Copy link
Copy Markdown
📝 Walkthrough

Walkthrough

디버그 로그 문을 제거하고, 훅의 studyType 옵션 타입을 API 요청 타입과 일치하도록 정렬하는 경미한 코드 정리 작업입니다. 로직 흐름이나 기능 동작에는 변화가 없습니다.

Changes

Cohort / File(s) Summary
디버그 로그 제거
src/components/section/my-participating-studies-section.tsx
렌더링 중 콘솔 출력을 일으키던 console.log({ myStudiesData }) 디버그 문을 제거했습니다.
타입 정렬
src/hooks/common/use-group-study-review-reminder.ts
UseGroupStudyReviewReminderOptions.studyType을 하드코딩된 유니온 타입에서 MemberStudyListRequest['studyType']로 변경하여 API 요청 타입과 일치시켰습니다. 관련 타입 전용 임포트를 추가했습니다.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Possibly related PRs

Poem

🐰 콘솔의 잡음을 걷어내고,
타입들을 정렬하는 우리,
API와 함께 춤을 추네~ ✨
깔끔한 코드, 깔끔한 마음,
작은 손질로 완성된다! 🎯

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed PR 제목 '인터페이스 수정'은 실제 변경사항의 핵심 내용을 명확하게 반영하고 있습니다. 변경사항은 UseGroupStudyReviewReminderOptions.studyType 인터페이스 필드를 MemberStudyListRequest 타입으로 업데이트하고 불필요한 console.log를 제거한 것이 주요 변경입니다.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ 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 fix/review-modal-main

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 and usage tips.

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

🧹 Nitpick comments (1)
src/hooks/common/use-group-study-review-reminder.ts (1)

10-12: 훅 입력 타입이 도메인보다 과도하게 넓어졌습니다.

studyTypeMemberStudyListRequest['studyType']로 받으면 'BOTH' | 'ONE_ON_ONE_STUDY' | undefined까지 허용됩니다. 이 훅은 /group-studies/.../reviews/written 흐름을 전제로 하므로, 허용값을 'GROUP_STUDY' | 'MENTOR_STUDY'로 제한하거나 최소한 런타임 가드로 필터링하는 편이 안전합니다. 지금 타입 계약은 미래 리팩터링 시 잘못된 값 유입을 막지 못합니다.

예시 수정안
 interface UseGroupStudyReviewReminderOptions {
-  studyType: MemberStudyListRequest['studyType'];
+  studyType: 'GROUP_STUDY' | 'MENTOR_STUDY';
 }
+const SUPPORTED_STUDY_TYPE = {
+  GROUP_STUDY: true,
+  MENTOR_STUDY: true,
+} as const;
+
 export function useGroupStudyReviewReminder({
   studyType,
 }: UseGroupStudyReviewReminderOptions) {
+  if (!(studyType in SUPPORTED_STUDY_TYPE)) {
+    return {
+      showReviewModal: false,
+      setShowReviewModal: () => {},
+      showCompletionModal: false,
+      setShowCompletionModal: () => {},
+      reviewStudyId: undefined,
+      reviewDetailInfo: undefined,
+      reviewBasicInfo: undefined,
+    };
+  }

As per coding guidelines **/*.{tsx,ts}: For enum-like string types from backend, use in operator guard with fallback instead of simple as type assertion.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/hooks/common/use-group-study-review-reminder.ts` around lines 10 - 12,
The hook's input type UseGroupStudyReviewReminderOptions currently accepts
MemberStudyListRequest['studyType'] which is too broad; change the contract to
only allow the expected values ('GROUP_STUDY' | 'MENTOR_STUDY') or add a runtime
guard inside the hook (use-group-study-review-reminder / the function that reads
studyType) that uses the in operator against the backend enum shape and filters
out/throws on other values so only the '/group-studies/.../reviews/written' flow
is processed; do not use simple `as` assertions—validate and narrow the value at
runtime and adjust the interface to the narrower union if possible.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@src/hooks/common/use-group-study-review-reminder.ts`:
- Around line 10-12: The hook's input type UseGroupStudyReviewReminderOptions
currently accepts MemberStudyListRequest['studyType'] which is too broad; change
the contract to only allow the expected values ('GROUP_STUDY' | 'MENTOR_STUDY')
or add a runtime guard inside the hook (use-group-study-review-reminder / the
function that reads studyType) that uses the in operator against the backend
enum shape and filters out/throws on other values so only the
'/group-studies/.../reviews/written' flow is processed; do not use simple `as`
assertions—validate and narrow the value at runtime and adjust the interface to
the narrower union if possible.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 495a7e8d-6b22-41d0-9d5a-5d1e3e5a3bc5

📥 Commits

Reviewing files that changed from the base of the PR and between e59ec20 and 0c071f3.

📒 Files selected for processing (2)
  • src/components/section/my-participating-studies-section.tsx
  • src/hooks/common/use-group-study-review-reminder.ts
💤 Files with no reviewable changes (1)
  • src/components/section/my-participating-studies-section.tsx

@HA-SEUNG-JEONG HA-SEUNG-JEONG merged commit 0d6f72e into main Mar 26, 2026
9 of 10 checks passed
@HA-SEUNG-JEONG HA-SEUNG-JEONG deleted the fix/review-modal-main branch March 26, 2026 16:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant