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

[KM-191] 수정:주문서 , 장바구니 페이지에 axios 적용 및 코드 수정 #68

Merged
merged 3 commits into from
Sep 15, 2023

Conversation

2jie0516
Copy link
Collaborator

🔍 어떤 PR인가요?

  • 기존 fetch 만 사용하였던 코드에 axios를 적용하였습니다 !

😋 To Reviewer

  • axios를 적용하면서 약간의 코드 수정이 있었습니다

Copy link
Collaborator

@Hejow Hejow left a comment

Choose a reason for hiding this comment

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

프론트 하시느라 고생이 많으셔요 ㅠㅠ 이번주만 아좌조ㅓ
간단한 리뷰 남겨두렸으니 한번 참고해보세요!!
아 그리구 api가 한 곳에 몰려있으면 뭔가 view와 logic을 분리할 수도 있는데 이거는 사실 프론트라 무시하셔도 됩니다 ㅋㅋㅎ😜

body: JSON.stringify(cart),
});
return { ...cart, quantity: cart.quantity + 1 };
const increaseQuantity = (cartId) => {
Copy link
Collaborator

Choose a reason for hiding this comment

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

아 요렇개 구현하셨군요! 👍
ApiController 측에 있는 JwtInterceptor를 사용하시면 자동으로 저장된 토큰을 헤더에 넣어줄거랍니다! 한번 제 코드 참고해보시면 좋을 것 같아요!!

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

a52a124 피드백 반영

  • jwt 인터셉터를 적용해보았습니다 !
  • 근데 아직 도커 이슈 땜에 db 연동을 못해서 테스트 데이터로 처리하고 , 인터셉트는 주석으로 남겨두었습니다 ㅠ

<td>{cart.name}</td>
<td>${cart.price}</td>
<td>
<button onClick={() => decreaseQuantity(cart.cartId, cart.productId)}>-</button>
Copy link
Collaborator

Choose a reason for hiding this comment

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

같은 파일이라서 여기서 값을 넘겨주지 않아도 괜찮을 것 같은데 어떻게 생각하시나요?? 그러면 arrow function을 사용하지 않아도 될 것 같아요 ㅎㅎ!

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

음 .. 근데 카트 데이터가 여러 개여서 해당 데이터만을 넘겨주어야 하기 때문에 일단은 저렇게 해주었습니다 !
혹시 프론트 하시다가 이상 있으시면 말씀해주세용 !

@@ -1,54 +1,44 @@
import { useState } from 'react';
import React, {useState} from 'react';
Copy link
Collaborator

Choose a reason for hiding this comment

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

React는 빼도 될 것 같아용! 이제 잘 지원합니당 ㅎㅎ

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

304abe8 피드백 반영

  • 넵 제거 하였습니당

@2jie0516 2jie0516 merged commit e38f87a into main Sep 15, 2023
1 check passed
@2jie0516 2jie0516 deleted the KM-191-sehan branch September 15, 2023 07:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants