Skip to content

캐릭터 도감 / 모임원 조회 / 참여자 선택 실제 API 연결#31

Merged
yoouyeon merged 7 commits intodevelopfrom
feat/MD-28
Apr 19, 2026
Merged

캐릭터 도감 / 모임원 조회 / 참여자 선택 실제 API 연결#31
yoouyeon merged 7 commits intodevelopfrom
feat/MD-28

Conversation

@yoouyeon
Copy link
Copy Markdown
Contributor

@yoouyeon yoouyeon commented Apr 12, 2026

💻 작업 내용

실제 API 연결 (mock 제거)

캐릭터 도감 조회 (GET /collections)

  • 엔드포인트 변경: /character/collection/collections
  • 응답 구조 변경: characterscollections,
    isUnlocked 제거 → acquiredAt: Date | null로 잠금 여부 판단
  • API 함수에서 acquiredAt string → Date 변환 (Raw 타입 / 변환 타입 분리)

모임원 조회 (GET /groups/{code}/members)

  • paidAt string → Date 변환을 API 함수에서 처리
  • MemberProfileRaw / MemberProfileRawData Raw 타입 추가

참여자 선택 (POST /groups/{code}/members/assign)

  • 반환 타입 voidMemberProfile (응답으로 받은 멤버 객체 활용)
  • removeQueriessetQueryData 교체: 응답 데이터로 캐시를 즉시 갱신해 리패치 없이 반영
  • 에러 처리: useMutationuseMutationWithHandlers, 실패 시 toast 표시

코드 개선

캐릭터 데이터 통합 (CHARACTER_DATA)

  • 기존: CharacterType union + CHARACTER_IMAGE_SIZE + CHARACTER_DESCRIPTION 세 곳을 각각 관리
  • 변경: 단일 CHARACTER_DATA 객체로 통합, CharacterTypekeyof typeof CHARACTER_DATA로 파생
  • 새 캐릭터 추가 시 CHARACTER_DATA 한 곳만 수정하면 타입이 자동으로 확장됨

getCharacterCollection wrapper 제거

  • 변환 후에도 { collections: [...] } wrapper를 유지하다 select에서 즉시 꺼내는 불필요한 구조 제거
  • API 함수가 CharacterItemData[]를 직접 반환하도록 변경, CharacterItemsResponse 타입 제거

그 외에 사용하지 않는 타입을 제거했습니다!

👻 리뷰 요구사항

참여자 선택 에러 처리

실제 에러 코드가 API 문서에 명시되지 않아 ignoreBoundaryErrors: [400, 409]로 임시 처리하고 TODO를 남겼습니다. 실제 에러 코드 확인 후에 세부적으로 처리하겠습니다!

Summary by CodeRabbit

릴리스 노트

  • 새로운 기능

    • 캐릭터 획득 날짜 추적 및 표시 기능 강화
  • 버그 수정

    • 회원 프로필 할당 시 캐시 동기화 개선
    • 오류 처리 로직 강화
  • 리팩터

    • 캐릭터 정보 데이터 구조 통합
    • 날짜 파싱 및 변환 정규화

- api endpoint 실제 구조에 맞게 수정
- 타입 실제 구조에 맞게 수정
- api endpoint 실제 구조에 맞게 수정
- 타입 실제 구조에 맞게 수정
- 에러 처리 추가 (토스트)
- 리페치 대신 응답을 받아 캐시를 업데이트하도록 변경
- 복잡하게 얽혀있던 타입과 데이터를 CHARACTER_DATA 하나에서 관리하도록 수정
- 타입을 CHARACTER_DATA에서 파생해서 생성하도록 수정
백엔드 응답 타입에 맞추기 위해서 collections에 담아서 사용중이었음
실제로 사용할때는 collections에서 꺼낸 형태로 사용하고 있었기 때문에
불필요하게 감쌌다가 다시 꺼내는 로직과 관련 타입 제거
@yoouyeon yoouyeon self-assigned this Apr 12, 2026
@yoouyeon yoouyeon added the ✨ Feature 신규 기능 추가 label Apr 12, 2026
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 12, 2026

🚥 Pre-merge checks | ✅ 1
✅ Passed checks (1 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

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

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/MD-28

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.

@github-actions github-actions Bot requested a review from ongheong April 12, 2026 04:39
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 12, 2026

📝 관련 이슈

MD-28

Copy link
Copy Markdown

@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

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@src/entities/character/api/character.ts`:
- Around line 8-12: The mapping of axiosInstance.get<CharacterItemsRawResponse>
currently does new Date(item.acquiredAt) which can produce an Invalid Date and
later cause a RangeError when format(acquiredAt, 'yyyy.MM.dd') is called; update
the map in the axiosInstance.get response handling to parse and validate the
date using parseISO(item.acquiredAt) and isValid(...) from date-fns (or
equivalent), only converting to a Date when valid and otherwise setting
acquiredAt to null, keeping the rest of the item spread intact—refer to
axiosInstance.get, CharacterItemsRawResponse, and the acquiredAt property when
making this change.
🪄 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: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 22aa1026-9f17-4672-a0ad-57ee8ba46c99

📥 Commits

Reviewing files that changed from the base of the PR and between 691a8c3 and a8b73df.

📒 Files selected for processing (12)
  • src/entities/character/api/character.ts
  • src/entities/character/config/character.ts
  • src/entities/character/model/character.type.ts
  • src/entities/member/api/assignMember.ts
  • src/entities/member/api/getProfiles.ts
  • src/entities/member/model/member.type.ts
  • src/features/character-management/api/useGetCharacterCollection.ts
  • src/features/character-management/ui/CharacterBottomSheet/index.tsx
  • src/features/character-management/ui/CharacterItem/index.tsx
  • src/features/join/api/useAssignMember.ts
  • src/mocks/handlers/character.ts
  • src/pages/characterShare/CharacterSharePage.tsx
👮 Files not reviewed due to content moderation or server errors (4)
  • src/entities/member/model/member.type.ts
  • src/entities/member/api/getProfiles.ts
  • src/entities/member/api/assignMember.ts
  • src/features/join/api/useAssignMember.ts

Comment thread src/entities/character/api/character.ts
@cloudflare-workers-and-pages
Copy link
Copy Markdown

cloudflare-workers-and-pages Bot commented Apr 12, 2026

Deploying moddo-frontend with  Cloudflare Pages  Cloudflare Pages

Latest commit: e59b17c
Status:🚫  Build failed.

View logs

Copy link
Copy Markdown
Contributor

@ongheong ongheong left a comment

Choose a reason for hiding this comment

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

코드 확인했습니다~~! 실제 API도 붙어서 이제 전체 플로우 테스트할 날이 머지않았네요. 반영감사합니다!

Base automatically changed from feat/MD-22 to develop April 19, 2026 06:46
@yoouyeon yoouyeon merged commit e9d6c23 into develop Apr 19, 2026
1 of 2 checks passed
@yoouyeon yoouyeon deleted the feat/MD-28 branch April 19, 2026 10:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

✨ Feature 신규 기능 추가

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants