Skip to content

Conversation

@seongwon030
Copy link
Member

@seongwon030 seongwon030 commented Jan 19, 2026

#️⃣연관된 이슈

ex) #이슈번호, #이슈번호

📝작업 내용

  • API 응답에서 semesterTerm 필드를 사용하지만 코드에서는 semester 필드만 체크하여 렌더링 실패
  • formatSemesterLabel과 getAwardKey에서 semesterTerm과 semester 두 필드명 모두 지원하도록 수정
  • null/undefined 안전성을 위해 옵셔널 체이닝 적용

중점적으로 리뷰받고 싶은 부분(선택)

리뷰어가 특별히 봐주었으면 하는 부분이 있다면 작성해주세요

ex) 메서드 XXX의 이름을 더 잘 짓고 싶은데 혹시 좋은 명칭이 있을까요?

논의하고 싶은 부분(선택)

논의하고 싶은 부분이 있다면 작성해주세요.

🫡 참고사항

Summary by CodeRabbit

릴리스 노트

  • 개선 사항
    • 학기 필드명 변경(semester → semesterTerm)에 맞춰 학기 판별·표시 로직을 일관되게 정비했습니다.
  • 테스트
    • 관련 단위 테스트를 새 필드명에 맞게 업데이트하여 동작을 검증했습니다.

✏️ Tip: You can customize this high-level summary in your review settings.

- API 응답에서 semesterTerm 필드를 사용하지만 코드에서는 semester 필드만 체크하여 렌더링 실패
- formatSemesterLabel과 getAwardKey에서 semesterTerm과 semester 두 필드명 모두 지원하도록 수정
- null/undefined 안전성을 위해 옵셔널 체이닝 적용
- 모든 테스트 통과 확인
@seongwon030 seongwon030 self-assigned this Jan 19, 2026
@seongwon030 seongwon030 added 💻 FE Frontend 🚀 hotfix 즉시 릴리즈할 부분 labels Jan 19, 2026
@vercel
Copy link

vercel bot commented Jan 19, 2026

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

Project Deployment Review Updated (UTC)
moadong Ready Ready Preview, Comment Jan 19, 2026 9:14am

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 19, 2026

Caution

Review failed

The pull request is closed.

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.
  • You can also validate your configuration using the online YAML validator.
  • 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

Award 타입의 필드명을 semester에서 semesterTerm으로 변경하고, 해당 변경을 반영해 학기 표기/키 생성 유틸과 관련 테스트 및 에디터 컴포넌트 내 모든 참조를 semesterTerm 기반으로 업데이트했습니다. 공개 함수 시그니처는 변경되지 않았습니다.

Changes

Cohort / File(s) 요약
타입 변경 — Award 인터페이스
frontend/src/types/club.ts
Award 인터페이스에서 semestersemesterTerm: SemesterTermType로 필드명 변경.
유틸리티 업데이트 — 학기 처리 로직
frontend/src/utils/awardHelpers.ts
내부 구현을 award.semesterTerm 기반으로 변경 (formatSemesterLabel, getAwardKey 등). 공개 시그니처는 불변.
테스트 업데이트
frontend/src/utils/awardHelpers.test.ts
테스트 데이터와 assertions에서 semestersemesterTerm으로 교체 및 관련 테스트 설명/검증 업데이트.
컴포넌트 업데이트 — 어워드 에디터
frontend/src/pages/AdminPage/tabs/ClubIntroEditTab/components/AwardEditor/AwardEditor.tsx
에디터 내 정렬값, 키 생성, 중복 검사, 새 항목 생성 등 모든 award.semester 참조를 award.semesterTerm으로 교체.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Suggested labels

🛠Fix

Suggested reviewers

  • oesnuj
  • lepitaaar
🚥 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 제목은 ClubIntroContent 어워드 렌더링 문제 해결을 명확하게 설명하고 있으며, 실제 변경사항(semester에서 semesterTerm으로의 필드명 변경)과 일치합니다.
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

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.

Copy link
Contributor

@lepitaaar lepitaaar left a comment

Choose a reason for hiding this comment

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

기존 semester를 사용하고있었네요.. 필드오류 수정 감사합니다

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Fix all issues with AI agents
In `@frontend/src/utils/awardHelpers.ts`:
- Line 4: Update the Award type to include an optional semesterTerm?:
SemesterTerm in your types (e.g., "@/types/club" Award interface) and then
remove the unsafe cast in frontend/src/utils/awardHelpers.ts; replace the
current semesterValue assignment that uses (award as any)?.semesterTerm ||
award?.semester with a nullish-coalescing lookup using the typed property (e.g.,
semesterValue = award.semesterTerm ?? award.semester) so you preserve type
safety and avoid falsy-value fallthrough.
🧹 Nitpick comments (1)
frontend/src/utils/awardHelpers.ts (1)

14-17: 중복 로직을 헬퍼 함수로 추출하세요.

동일한 semester 값 추출 로직이 두 함수에서 반복됩니다. DRY 원칙에 따라 헬퍼 함수로 추출하는 것을 권장합니다.

또한, semesterValueundefined일 경우 키가 "2024-undefined-0" 형태가 되어 동일한 year와 index를 가진 항목들 간에 키 충돌이 발생할 수 있습니다.

♻️ 권장 리팩토링
+const getSemesterValue = (award: Award): SemesterTerm | undefined => {
+  return award?.semesterTerm ?? award?.semester;
+};
+
 export const formatSemesterLabel = (award: Award): string | null => {
-  const semesterValue = (award as any)?.semesterTerm || award?.semester;
+  const semesterValue = getSemesterValue(award);

   if (award?.year && semesterValue) {
     const semesterLabel =
       semesterValue === SemesterTerm.FIRST ? '1학기' : '2학기';
     return `${award.year} ${semesterLabel}`;
   }
   return null;
 };

 export const getAwardKey = (award: Award, index: number): string => {
-  const semesterValue = (award as any)?.semesterTerm || award?.semester;
-  return `${award.year}-${semesterValue}-${index}`;
+  const semesterValue = getSemesterValue(award);
+  return `${award.year}-${semesterValue ?? 'unknown'}-${index}`;
 };

- AwardEditor.tsx의 모든 참조 수정
Copy link
Contributor

@lepitaaar lepitaaar left a comment

Choose a reason for hiding this comment

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

필드 전부변경하신거 좋습니다~

@seongwon030 seongwon030 merged commit 46edc13 into develop-fe Jan 19, 2026
2 of 3 checks passed
@seongwon030 seongwon030 deleted the fix/award-rendering-issue branch January 19, 2026 09:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

💻 FE Frontend 🚀 hotfix 즉시 릴리즈할 부분

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants