Skip to content

feat : 장소별 곡 좋아요 등록 API 연동 - #129

Merged
6 commits merged into
developfrom
feat/128-liked-track-put-api
Aug 2, 2026
Merged

6 commits merged into
developfrom
feat/128-liked-track-put-api

Conversation

@kim3360

@kim3360 kim3360 commented Jul 30, 2026

Copy link
Copy Markdown
Member

변경 내용

장소별 곡 좋아요 등록 API(PUT /api/v1/place-tracks/{placeTrackId}/likes)를 연동하고, PinCard 하트 클릭 시 좋아요가 등록되도록 변경했습니다.

  • putLikedTracks API 함수 추가
  • usePutLikedTrack mutation 훅 추가 (성공 시 likeTrack / placeTrack 쿼리 invalidate)
  • PinCard 하트 클릭 시 좋아요 등록 연동
  • 이미 좋아요한 곡은 재요청하지 않도록 처리

관련 이슈

Closes #128

변경 사항

  • 새로운 기능 추가
  • 버그 수정
  • UI/UX 개선
  • 리팩토링
  • 문서 업데이트

테스트

  • 브라우저에서 정상 동작 확인
  • 기존 기능에 영향 없음 확인

스크린샷 (UI 변경시)

체크리스트

  • 코드가 정상적으로 동작합니다
  • 새로운 에러나 경고가 없습니다
  • 필요시 문서를 업데이트했습니다
  • 코드 포맷팅을 실행했습니다 (pnpm format)
  • ESLint 검사를 통과했습니다 (pnpm lint:fix)

코드 품질 확인
PR 제출 전에 다음 명령어를 실행하여 코드 품질을 확인해주세요:

pnpm lint:fix
pnpm format

Summary by CodeRabbit

  • 새로운 기능

    • 장소별 트랙과 좋아요한 트랙을 불러오는 기능이 추가되었습니다.
    • 핀 목록에서 트랙 좋아요를 직접 등록할 수 있습니다.
    • 좋아요 탭에서 실제 좋아요한 트랙 목록과 빈 상태가 표시됩니다.
    • 핀 카드에 앨범 아트워크, 트랙명, 아티스트 정보가 표시됩니다.
  • 개선

    • 장소 트랙 목록에 인기순·최신순 정렬을 적용했습니다.
    • 좋아요 및 장소 트랙 데이터가 변경 후 자동으로 갱신됩니다.
    • 트랙 목록을 불러오는 동안 기존 데이터가 유지됩니다.

@kim3360
kim3360 requested review from JeongGyul, L0521 and onebone July 30, 2026 22:03
@kim3360 kim3360 self-assigned this Jul 30, 2026
@coderabbitai

coderabbitai Bot commented Jul 30, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

장소별 트랙과 좋아요 트랙 API가 추가되고, 관련 응답 타입과 React Query 훅이 구현되었습니다. 핀 목록·카드·찜한 노래 화면은 실제 트랙 데이터를 사용하며, 정렬 값은 대문자 리터럴로 통일되었습니다.

Changes

트랙 계약 및 API·쿼리 계층

Layer / File(s) Summary
트랙 타입과 API·쿼리 계층
src/features/pin/types.ts, src/api/track.ts, src/features/pin/queries/*
공통 트랙 필드와 장소별·좋아요 응답 타입을 추가하고, 트랙 조회·좋아요 등록 API와 React Query 훅을 구현했습니다.

장소별 트랙 시트 연결

Layer / File(s) Summary
장소별 트랙 시트 연결
src/features/pin/components/PinListSheet.tsx, src/features/pin/components/SortTabs.tsx, src/pages/PinDetailPage.tsx, src/pages/MapPage.tsx
PinListSheet가 장소별 트랙을 직접 조회하고 정렬 값을 LATEST·POPULAR로 사용하도록 변경했습니다.

좋아요 등록 및 찜한 노래 화면

Layer / File(s) Summary
좋아요 등록 및 찜한 노래 화면
src/features/pin/components/PinCard.tsx, src/pages/MyPlimapPage.tsx, src/features/pin/data/mockPinSearchPlaces.ts
PinCard의 좋아요 버튼이 mutation을 호출하고, MyPlimapPage가 좋아요 트랙 목록과 빈 상태를 렌더링하도록 변경했습니다. 관련 목 데이터도 새 트랙 필드에 맞게 수정했습니다.

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

Sequence Diagram(s)

sequenceDiagram
  participant PinListSheet
  participant usePlaceTrack
  participant getPlaceTracks
  participant TrackAPI
  PinListSheet->>usePlaceTrack: 장소 좌표·정렬 조건 전달
  usePlaceTrack->>getPlaceTracks: 트랙 목록 조회
  getPlaceTracks->>TrackAPI: GET 장소별 트랙 요청
  TrackAPI-->>PinListSheet: 트랙 목록 반환
Loading
sequenceDiagram
  participant PinCard
  participant usePutLikedTrack
  participant putLikedTracks
  participant TrackAPI
  PinCard->>usePutLikedTrack: placeTrackId 전달
  usePutLikedTrack->>putLikedTracks: 좋아요 등록 실행
  putLikedTracks->>TrackAPI: PUT 좋아요 요청
  TrackAPI-->>usePutLikedTrack: 등록 결과 반환
  usePutLikedTrack-->>PinCard: 관련 쿼리 무효화
Loading

Possibly related issues

Possibly related PRs

Suggested labels: feature

Suggested reviewers: onebone, jeonggyul

🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed 제목이 장소별 곡 좋아요 등록 API 연동이라는 핵심 변경을 정확히 요약합니다.
Linked Issues check ✅ Passed PUT 좋아요 API, mutation 훅, PinCard 클릭 연동, 중복 요청 방지, 목록 갱신까지 요구사항을 충족합니다.
Out of Scope Changes check ✅ Passed 핵심 변경은 좋아요 연동과 그에 필요한 목록·타입·UI 보조 수정이며, 명백한 무관 변경은 보이지 않습니다.
✨ 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/128-liked-track-put-api

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.

@github-actions

Copy link
Copy Markdown

https://pr-129.plimap.kr

@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: 3

🤖 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 `@src/api/track.ts`:
- Around line 31-45: 장소별 트랙 조회가 선택된 장소와 좌표를 사용하도록 전체 호출 흐름을 수정하세요.
src/api/track.ts의 getPlaceTracks에 placeId를 추가하고 요청 경로를 해당 식별자로 구성하세요.
src/features/pin/queries/usePlaceTrack.ts의 훅 입력과 queryKey에 placeId·위도·경도를 포함하세요.
src/features/pin/components/PinListSheet.tsx에서는 선택된 place의 식별자와 좌표를
usePlaceTrack에 전달하세요.

In `@src/features/pin/components/PinListSheet.tsx`:
- Around line 122-131: Update the usePlaceTrack state handling in PinListSheet
so missing data is not treated as an empty pin list. Use isPending to render the
loading state and isError to render a retryable error state, while preserving
the empty-list message only for successful responses with no tracks; keep the
existing pins mapping for loaded data.

In `@src/pages/MyPlimapPage.tsx`:
- Around line 64-70: Update the track-list rendering in MyPlimapPage so the
loading and error states from useLikeTrack are handled before the tracks.length
=== 0 empty-state check. Only render “아직 찜한 노래가 없어요” after the request succeeds
and the returned tracks collection is genuinely empty.
🪄 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 Plus

Run ID: 148a506e-8de0-4395-959a-27fee056958d

📥 Commits

Reviewing files that changed from the base of the PR and between 3d58069 and 1f772c0.

📒 Files selected for processing (12)
  • src/api/track.ts
  • src/features/pin/components/PinCard.tsx
  • src/features/pin/components/PinListSheet.tsx
  • src/features/pin/components/SortTabs.tsx
  • src/features/pin/data/mockPinSearchPlaces.ts
  • src/features/pin/queries/useLikeTrack.ts
  • src/features/pin/queries/usePlaceTrack.ts
  • src/features/pin/queries/usePutLikedTrack.ts
  • src/features/pin/types.ts
  • src/pages/MapPage.tsx
  • src/pages/MyPlimapPage.tsx
  • src/pages/PinDetailPage.tsx
💤 Files with no reviewable changes (1)
  • src/pages/MapPage.tsx

Comment thread src/api/track.ts
Comment thread src/features/pin/components/PinListSheet.tsx
Comment thread src/pages/MyPlimapPage.tsx
@coderabbitai coderabbitai Bot mentioned this pull request Aug 2, 2026
12 tasks
@kim3360 kim3360 closed this pull request by merging all changes into develop in ef61a64 Aug 2, 2026
@kim3360
kim3360 temporarily deployed to preview-maintenance August 2, 2026 14:02 — with GitHub Actions Inactive

This branch was successfully deployed

1 active and 1 inactive deployments
preview-maintenance 1f772c05 Deployed Aug 2, 2026 by kim3360 via cleanup #238
preview 1f772c05 Deployed Jul 30, 2026 by kim3360 via deploy #157
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature Feature implementation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

장소별 곡 좋아요 등록 API 연동

2 participants