-
Notifications
You must be signed in to change notification settings - Fork 1
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
낙관적 업데이트 저도 안해봤는데 너무 잘 해내신 거 같아요🥹 수고하셨습니다!!!
import { useDeleteCakeLikes } from '@apis/likes/useDeleteCakeLikes'; | ||
import { useDeleteStoreLikes } from '@apis/likes/useDeleteStoreLikes'; |
There was a problem hiding this comment.
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
경로로 통일하면 좋을 것 같습니다!
src/constants/apis/api.ts
Outdated
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}` |
There was a problem hiding this comment.
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}`;
간단한 예시긴 하지만 이런 식으로 통합해볼 수.. 있을 것 같아요! 물론 리팩토링 때 고려해봐도 좋긴 합니다:)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
고생 많으셨습니다! 😍
📌 관련 이슈번호
체크리스트
✅ Key Changes