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

전남대 FE_정서윤 6주차 과제 Step3 #94

Open
wants to merge 21 commits into
base: yunn23
Choose a base branch
from

Conversation

yunn23
Copy link

@yunn23 yunn23 commented Aug 3, 2024

  • 마이페이지에 포인트 조회 기능 추가하였습니다.
    • 현재 포인트 조회시 403 에러가 뜨고 있는데 네트워크의 헤더를 보면 request와 response 요구사항은 다 맞춘 것 같아, 오류 해결을 하기 위해서는 서버 로그를 확인해봐야할 것 같습니다..

  • 저희 조의 포인트 관련 api는 다음과 같습니다
image

@taehwanno taehwanno self-requested a review August 4, 2024 02:40
Copy link

@taehwanno taehwanno left a comment

Choose a reason for hiding this comment

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

피드백 드려요!

fetchPoint();
}, []);

return { point, loading, error, fetchPoint };

Choose a reason for hiding this comment

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

다른 코드와 일관되도록 react-query 사용하셔서 처리하는게 로딩, 에러 처리, 캐싱, retry 처리를 직접 해주지 않아도 되기 때문에 더 나은 선택 같아요.

@@ -72,7 +73,7 @@ export const useRemoveFromWishlist = (fetchWishlist: () => void) => {
const removeFromWishlist = async (wishId: number) => {
try {
setLoading(true);
await fetchWithTokenInstance.delete(`/api/wishes/${wishId}`);
await fetchInstance().delete(`/api/wishes/${wishId}`);

Choose a reason for hiding this comment

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

GET 요청 뿐만 아니라 POST, PUT, DELETE와 같이 Mutation을 가정하는 HTTP Method도 react-query를 통해 활용할 수 있어요. Mutations 문서 참고 부탁드려요.

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.

2 participants