Remove debug console logs from review components
🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -28,8 +28,6 @@ export function ProductReviews({ productId, type }: ProductReviewsProps) {
|
|||||||
}, [productId, type]);
|
}, [productId, type]);
|
||||||
|
|
||||||
const fetchReviews = async () => {
|
const fetchReviews = async () => {
|
||||||
console.log('fetchReviews called - productId:', productId, 'type:', type);
|
|
||||||
|
|
||||||
let query = supabase
|
let query = supabase
|
||||||
.from('reviews')
|
.from('reviews')
|
||||||
.select('id, rating, title, body, created_at, reviewer_name, profiles!user_id (name)')
|
.select('id, rating, title, body, created_at, reviewer_name, profiles!user_id (name)')
|
||||||
@@ -41,10 +39,7 @@ export function ProductReviews({ productId, type }: ProductReviewsProps) {
|
|||||||
query = query.eq('type', type);
|
query = query.eq('type', type);
|
||||||
}
|
}
|
||||||
|
|
||||||
const { data, error } = await query.order('created_at', { ascending: false }).limit(3);
|
const { data } = await query.order('created_at', { ascending: false }).limit(3);
|
||||||
|
|
||||||
console.log('Raw reviews data:', data);
|
|
||||||
console.log('Error:', error);
|
|
||||||
|
|
||||||
if (data && data.length > 0) {
|
if (data && data.length > 0) {
|
||||||
const typedData = data as unknown as Review[];
|
const typedData = data as unknown as Review[];
|
||||||
|
|||||||
@@ -21,18 +21,13 @@ export function TestimonialsSection() {
|
|||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
const fetchReviews = async () => {
|
const fetchReviews = async () => {
|
||||||
console.log('TestimonialsSection fetchReviews called');
|
const { data } = await supabase
|
||||||
|
|
||||||
const { data, error } = await supabase
|
|
||||||
.from('reviews')
|
.from('reviews')
|
||||||
.select('id, rating, title, body, created_at, reviewer_name, profiles!user_id (name)')
|
.select('id, rating, title, body, created_at, reviewer_name, profiles!user_id (name)')
|
||||||
.eq('is_approved', true)
|
.eq('is_approved', true)
|
||||||
.order('created_at', { ascending: false })
|
.order('created_at', { ascending: false })
|
||||||
.limit(6);
|
.limit(6);
|
||||||
|
|
||||||
console.log('TestimonialsSection - Raw data:', data);
|
|
||||||
console.log('TestimonialsSection - Error:', error);
|
|
||||||
|
|
||||||
if (data) {
|
if (data) {
|
||||||
setReviews(data as unknown as Review[]);
|
setReviews(data as unknown as Review[]);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user