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] 리뷰 api 연결 #91

Merged
merged 9 commits into from
Nov 29, 2024
Merged

[FEAT] 리뷰 api 연결 #91

merged 9 commits into from
Nov 29, 2024

Conversation

yarimu
Copy link
Collaborator

@yarimu yarimu commented Nov 28, 2024

관련 이슈 🛰️

해결한 이슈 번호를 작성해주세요
close #83

작업 내용 🧑‍💻

작업한 내용을 간략히 작성해주세요

  • 리뷰 컴포넌트 api 연결

알게된 점 🚀

기록하며 개발하기!

  • CI/CD
    깃허브 pr단에서 build에러를 잡을 수 있다는 것을 새롭게 알게되었습니다!
    build에러도 확인하고 머지하겠습니당!!

스크린샷 📸

2024-11-29.1.04.51.mov

@yarimu yarimu requested review from seong-hui and Taew00k November 28, 2024 16:10
@yarimu yarimu self-assigned this Nov 28, 2024
Copy link
Collaborator

Choose a reason for hiding this comment

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

tanstack query 잘 적용해주신 것 같아요 👍👍

@Taew00k
Copy link
Collaborator

Taew00k commented Nov 28, 2024

예림님 리뷰하면서 저도 tanstack-query 찾아보면서 개념 정리를 할 수 있었던 것 같아요 2주간 고생 많으셨습니다~~!!

Copy link
Collaborator

@seong-hui seong-hui left a comment

Choose a reason for hiding this comment

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

api 잘 붙여주신 것 확인했습니다! 에러 처리 부분을 에러 메세지를 콘솔에 찍어주는 방향으로만 수정하면 더욱 좋을 것 같아요! 고생하셨습니다!!

import instance from '@apis/instance';
import { AxiosError } from 'axios';

export interface Review {
Copy link
Collaborator

Choose a reason for hiding this comment

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

인터페이스 깰꼼하구만요!

const { data, isError } = useReviewQueries({ productId });

if (isError) {
console.error(isError);
Copy link
Collaborator

Choose a reason for hiding this comment

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

isError는 정말 에러인지 아닌지 true, false의 값만 가지고 있어서 해당 부분에서 true라는 콘솔이 찍히게 됩니다! 따라서 콘솔에서 구체적인 에러 메세지를 확인하고 싶다면 error를 받아와서 콘솔에 찍어와 주셔야 할 것 같아요!

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,128 +1,7 @@
import reviewImage from '@assets/images/img_review_4.png'; // 이미지 import
Copy link
Collaborator

Choose a reason for hiding this comment

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

아 요거 나중에 서버 끊기면 더미 데이터로 화면 띄워두려고 남겨둘려고 했는데 남겨주는 건 어떨까욤,,?

Copy link
Collaborator Author

@yarimu yarimu Nov 28, 2024

Choose a reason for hiding this comment

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

아! 남기는 것으로 수정하겠습니당!! 오홍

복구 완료 했습니다! import는 불러오기는 이름이 중복되서 나중에 서버 끊기면 갈아끼우겠솜당~

Copy link
Collaborator

@bykbyk0401 bykbyk0401 left a comment

Choose a reason for hiding this comment

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

확인했습니당!!! 너무 좋아요~~

import { getReview, GetReviewResponse } from './getReview';

const useReviewQueries = ({ productId }: { productId: number }) => {
const QUERY_KEY = {
Copy link
Collaborator

Choose a reason for hiding this comment

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

이렇게 QUERY_KEY를 만들기도 하는군요!

@seong-hui seong-hui merged commit 12d92e0 into develop Nov 29, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[FEAT] API 연결
4 participants