Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feat/#165] 스토어 찜 취소 / 디자인 찜 취소 API 연결 #167

Merged
merged 8 commits into from
Jan 22, 2025

Conversation

zzz-myam
Copy link
Collaborator

@zzz-myam zzz-myam commented Jan 21, 2025

📌 관련 이슈번호


체크리스트

  • 🎋 base 브랜치를 develop 브랜치로 설정했나요?
  • 🖌️ PR 제목은 형식에 맞게 잘 작성했나요?
  • 🏗️ 빌드는 성공했나요? (yarn build)
  • 🧹 불필요한 코드는 제거했나요? e.g. console.log
  • 🙇‍♂️ 리뷰어를 지정했나요?
  • 🏷️ 라벨은 등록했나요?

✅ Key Changes

이번 PR에서 작업한 내용을 간략히 설명해주세요

  • 스토어 찜 취소 / 디자인 찜 취소 API 연결

Copy link
Collaborator

@youtheyeon youtheyeon left a comment

Choose a reason for hiding this comment

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

낙관적 업데이트 저도 안해봤는데 너무 잘 해내신 거 같아요🥹 수고하셨습니다!!!

Comment on lines 4 to 5
import { useDeleteCakeLikes } from '@apis/likes/useDeleteCakeLikes';
import { useDeleteStoreLikes } from '@apis/likes/useDeleteStoreLikes';
Copy link
Collaborator

Choose a reason for hiding this comment

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

index.ts 에서 이 훅들도 함께 export 해줘서 @apis/likes 경로로 통일하면 좋을 것 같습니다!

Comment on lines 18 to 21
POST_CAKE_LIKES: (cakeId: number) => `/api/v1/cake/likes/${cakeId}`,
POST_STORE_LIKES: (storeId: number) => `/api/v1/store/likes/${storeId}`,
DELETE_CAKE_LIKES: (cakeId: number) => `/api/v1/cake/likes/${cakeId}`,
DELETE_STORE_LIKES: (storeId: number) => `/api/v1/store/likes/${storeId}`
Copy link
Collaborator

Choose a reason for hiding this comment

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

혹시 URL에서 cake와 store만 달라지는 것 같은데 혹시 번거롭지 않다면 찜 API 하나, 찜 삭제 API 하나로 통합해보는 건 어떨까요..?

POST_LIKE = (type: 'cake' | 'store', id: number) => `/api/v1/${type}/likes/${id}`;
DELETE_LIKE = (type: 'cake' | 'store', id: number) => `/api/v1/${type}/likes/${id}`;

간단한 예시긴 하지만 이런 식으로 통합해볼 수.. 있을 것 같아요! 물론 리팩토링 때 고려해봐도 좋긴 합니다:)

Copy link
Collaborator

@chaeneey chaeneey left a comment

Choose a reason for hiding this comment

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

고생 많으셨습니다! 😍

@thisishwarang thisishwarang merged commit d959b79 into develop Jan 22, 2025
2 of 3 checks passed
@thisishwarang thisishwarang deleted the feat/#165/cake-likes-delete-api branch January 22, 2025 11:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Feat] 스토어 찜 / 케이크 디자인 찜 취소 API 연결
4 participants