Changes
This commit is contained in:
@@ -9,7 +9,7 @@ interface Review {
|
||||
title: string;
|
||||
body: string;
|
||||
created_at: string;
|
||||
profiles: { full_name: string | null } | null;
|
||||
profiles: { name: string | null } | null;
|
||||
}
|
||||
|
||||
interface ProductReviewsProps {
|
||||
@@ -29,7 +29,7 @@ export function ProductReviews({ productId, type }: ProductReviewsProps) {
|
||||
const fetchReviews = async () => {
|
||||
let query = supabase
|
||||
.from('reviews')
|
||||
.select('id, rating, title, body, created_at, profiles:user_id (full_name)')
|
||||
.select('id, rating, title, body, created_at, profiles:user_id (name)')
|
||||
.eq('is_approved', true);
|
||||
|
||||
if (productId) {
|
||||
@@ -74,7 +74,7 @@ export function ProductReviews({ productId, type }: ProductReviewsProps) {
|
||||
rating={review.rating}
|
||||
title={review.title}
|
||||
body={review.body}
|
||||
authorName={review.profiles?.full_name || 'Anonymous'}
|
||||
authorName={review.profiles?.name || 'Anonymous'}
|
||||
date={review.created_at}
|
||||
/>
|
||||
))}
|
||||
|
||||
@@ -8,7 +8,7 @@ interface Review {
|
||||
title: string;
|
||||
body: string;
|
||||
created_at: string;
|
||||
profiles: { full_name: string | null } | null;
|
||||
profiles: { name: string | null } | null;
|
||||
}
|
||||
|
||||
export function TestimonialsSection() {
|
||||
@@ -22,7 +22,7 @@ export function TestimonialsSection() {
|
||||
const fetchReviews = async () => {
|
||||
const { data } = await supabase
|
||||
.from('reviews')
|
||||
.select('id, rating, title, body, created_at, profiles:user_id (full_name)')
|
||||
.select('id, rating, title, body, created_at, profiles:user_id (name)')
|
||||
.eq('is_approved', true)
|
||||
.order('created_at', { ascending: false })
|
||||
.limit(6);
|
||||
@@ -45,7 +45,7 @@ export function TestimonialsSection() {
|
||||
rating={review.rating}
|
||||
title={review.title}
|
||||
body={review.body}
|
||||
authorName={review.profiles?.full_name || 'Anonymous'}
|
||||
authorName={review.profiles?.name || 'Anonymous'}
|
||||
date={review.created_at}
|
||||
/>
|
||||
))}
|
||||
|
||||
Reference in New Issue
Block a user