diff --git a/src/components/reviews/ProductReviews.tsx b/src/components/reviews/ProductReviews.tsx index 1e37028..b32ffdd 100644 --- a/src/components/reviews/ProductReviews.tsx +++ b/src/components/reviews/ProductReviews.tsx @@ -28,6 +28,8 @@ export function ProductReviews({ productId, type }: ProductReviewsProps) { }, [productId, type]); const fetchReviews = async () => { + console.log('fetchReviews called - productId:', productId, 'type:', type); + let query = supabase .from('reviews') .select('id, rating, title, body, created_at, reviewer_name, profiles!user_id (name)') @@ -39,9 +41,10 @@ export function ProductReviews({ productId, type }: ProductReviewsProps) { query = query.eq('type', type); } - const { data } = await query.order('created_at', { ascending: false }).limit(3); + const { data, error } = await query.order('created_at', { ascending: false }).limit(3); console.log('Raw reviews data:', data); + console.log('Error:', error); if (data && data.length > 0) { const typedData = data as unknown as Review[];