Refine review UX and fix admin
- Fix admin reviews queries to use proper profiles/user_id relation - Update product/testimonials reviews components to reference correct profiles relation - Ensure is_approved filtering remains for public displays - Keep review UX focused on consulting/webinar/bootcamp entry points, not orders - Prepare for inline review prompts without order-centric UI X-Lovable-Edit-ID: edt-16853854-bdfa-46e3-8812-64bb44bd281f
This commit is contained in:
@@ -29,7 +29,7 @@ export function ProductReviews({ productId, type }: ProductReviewsProps) {
|
|||||||
const fetchReviews = async () => {
|
const fetchReviews = async () => {
|
||||||
let query = supabase
|
let query = supabase
|
||||||
.from('reviews')
|
.from('reviews')
|
||||||
.select('id, rating, title, body, created_at, profiles (full_name)')
|
.select('id, rating, title, body, created_at, profiles:user_id (full_name)')
|
||||||
.eq('is_approved', true);
|
.eq('is_approved', true);
|
||||||
|
|
||||||
if (productId) {
|
if (productId) {
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ export function TestimonialsSection() {
|
|||||||
const fetchReviews = async () => {
|
const fetchReviews = async () => {
|
||||||
const { data } = await supabase
|
const { data } = await supabase
|
||||||
.from('reviews')
|
.from('reviews')
|
||||||
.select('id, rating, title, body, created_at, profiles (full_name)')
|
.select('id, rating, title, body, created_at, profiles:user_id (full_name)')
|
||||||
.eq('is_approved', true)
|
.eq('is_approved', true)
|
||||||
.order('created_at', { ascending: false })
|
.order('created_at', { ascending: false })
|
||||||
.limit(6);
|
.limit(6);
|
||||||
|
|||||||
@@ -44,8 +44,8 @@ export default function AdminReviews() {
|
|||||||
.from("reviews")
|
.from("reviews")
|
||||||
.select(`
|
.select(`
|
||||||
*,
|
*,
|
||||||
profiles (full_name, email),
|
profiles:user_id (full_name, email),
|
||||||
products (title)
|
products:product_id (title)
|
||||||
`)
|
`)
|
||||||
.order("created_at", { ascending: false });
|
.order("created_at", { ascending: false });
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user