Skip to content

Commit

Permalink
refactor: 에러 코드리뷰 반영
Browse files Browse the repository at this point in the history
  • Loading branch information
yarimu committed Nov 28, 2024
1 parent 3a4b8d9 commit cf2de2f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/apis/productPage/review/reviewQueries.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@ const useReviewQueries = ({ productId }: { productId: number }) => {
PRODUCT_REVIEW: 'review',
};

const { data, isError } = useQuery<GetReviewResponse>({
const { data, error } = useQuery<GetReviewResponse>({
queryKey: [QUERY_KEY.PRODUCT_REVIEW, productId],
queryFn: () => getReview(productId),
});

return { data, isError };
return { data, error };
};

export default useReviewQueries;
6 changes: 3 additions & 3 deletions src/components/productPage/review/review/CardList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ interface CardListProps {
}

const CardList = ({ activeTab, isOriginal, productId }: CardListProps) => {
const { data, isError } = useReviewQueries({ productId });
const { data, error } = useReviewQueries({ productId });

if (isError) {
console.error(isError);
if (error) {
console.error(error);
}

// 데이터가 없을 경우
Expand Down

0 comments on commit cf2de2f

Please sign in to comment.