Skip to content

Conversation

@kyubumjang
Copy link
Contributor

@kyubumjang kyubumjang commented Oct 6, 2024

#️⃣ 연관된 이슈

#20 API 연동

📝 작업 내용

  • 찜 하기 API
  • 찜 삭제 API
  • 찜 리스트 가져오기 API

스크린샷

💬 리뷰 요구사항

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

@kyubumjang kyubumjang self-assigned this Oct 6, 2024
@cloudflare-workers-and-pages
Copy link

cloudflare-workers-and-pages bot commented Oct 6, 2024

Deploying sijak with  Cloudflare Pages  Cloudflare Pages

Latest commit: 42055f8
Status:🚫  Build failed.

View logs

@kyubumjang kyubumjang force-pushed the feature/api-integration-20-3 branch from 967fdcf to 42055f8 Compare October 6, 2024 18:17
console.log("좋아요!");
// TODO: 좋아요 API 연동

if (lectureData.heart === true) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

=== true, === false가 아닌 lectureData.heart / !lectureData.heart와 같이 하는게 더 괜찮을 것 같네요.

},
{
onSuccess: () => {
toast("좋아요 삭제 성공");
Copy link
Collaborator

Choose a reason for hiding this comment

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

좋아요 삭제 성공과 같은 MSG들은 constant에서 따로 상수로 정의해주세요.
SUCCESS_LIKE_MSG = ''

})}
{lectureInfo.instructor_name.map((instructor) => {
return instructor.instructor_history.map((history, idx) => {
return <li key={idx}>{history.content}</li>;
Copy link
Collaborator

Choose a reason for hiding this comment

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

key를 idx로 두게되면 react특성상 key값을 기준으로 판단을 하기에 정확하게 판단이 안 될 수도 있어요. 그래서 history의 특정 id값과 같은 것을 유니크 key값으로 설정해주세요

apiRequest.post<LikeLecture["Response"]>(
`${BASE_PATH}`,
{},
{
Copy link
Collaborator

Choose a reason for hiding this comment

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

authorization 객체는 axios interceptor에서 공통으로 처리해주세요

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.

3 participants