diff --git a/src/components/reviews/ProductReviews.tsx b/src/components/reviews/ProductReviews.tsx index be15a47..c01ef05 100644 --- a/src/components/reviews/ProductReviews.tsx +++ b/src/components/reviews/ProductReviews.tsx @@ -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} /> ))} diff --git a/src/components/reviews/TestimonialsSection.tsx b/src/components/reviews/TestimonialsSection.tsx index 4c16d3b..571600d 100644 --- a/src/components/reviews/TestimonialsSection.tsx +++ b/src/components/reviews/TestimonialsSection.tsx @@ -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} /> ))} diff --git a/src/pages/admin/AdminConsulting.tsx b/src/pages/admin/AdminConsulting.tsx index 9aadd68..8de4de6 100644 --- a/src/pages/admin/AdminConsulting.tsx +++ b/src/pages/admin/AdminConsulting.tsx @@ -31,7 +31,7 @@ interface ConsultingSlot { meet_link: string | null; created_at: string; profiles?: { - full_name: string; + name: string; email: string; }; } @@ -78,7 +78,7 @@ export default function AdminConsulting() { .from('consulting_slots') .select(` *, - profiles:user_id (full_name, email) + profiles:user_id (name, email) `) .order('date', { ascending: false }) .order('start_time', { ascending: true }); @@ -125,7 +125,7 @@ export default function AdminConsulting() { body: { template_key: 'consulting_scheduled', recipient_email: selectedSlot.profiles.email, - recipient_name: selectedSlot.profiles.full_name, + recipient_name: selectedSlot.profiles.name, variables: { consultation_date: format(parseISO(selectedSlot.date), 'd MMMM yyyy', { locale: id }), consultation_time: `${selectedSlot.start_time.substring(0, 5)} - ${selectedSlot.end_time.substring(0, 5)}`, @@ -168,7 +168,7 @@ export default function AdminConsulting() { start_time: selectedSlot.start_time, end_time: selectedSlot.end_time, topic: selectedSlot.topic_category, - client_name: selectedSlot.profiles?.full_name || 'Client', + client_name: selectedSlot.profiles?.name || 'Client', client_email: selectedSlot.profiles?.email, calendar_id: settings.integration_google_calendar_id, }), @@ -251,7 +251,7 @@ export default function AdminConsulting() { {todaySlots.map(slot => (
diff --git a/src/pages/member/MemberProfile.tsx b/src/pages/member/MemberProfile.tsx index b94a516..d7b4228 100644 --- a/src/pages/member/MemberProfile.tsx +++ b/src/pages/member/MemberProfile.tsx @@ -15,7 +15,7 @@ import { User, LogOut, Phone } from 'lucide-react'; interface Profile { id: string; email: string | null; - full_name: string | null; + name: string | null; avatar_url: string | null; whatsapp_number: string | null; whatsapp_opt_in: boolean; @@ -28,7 +28,7 @@ export default function MemberProfile() { const [loading, setLoading] = useState(true); const [saving, setSaving] = useState(false); const [form, setForm] = useState({ - full_name: '', + name: '', avatar_url: '', whatsapp_number: '', whatsapp_opt_in: false, @@ -48,7 +48,7 @@ export default function MemberProfile() { if (data) { setProfile(data); setForm({ - full_name: data.full_name || '', + name: data.name || '', avatar_url: data.avatar_url || '', whatsapp_number: data.whatsapp_number || '', whatsapp_opt_in: data.whatsapp_opt_in || false, @@ -78,7 +78,7 @@ export default function MemberProfile() { const { error } = await supabase .from('profiles') .update({ - full_name: form.full_name, + name: form.name, avatar_url: form.avatar_url || null, whatsapp_number: normalizedWA || null, whatsapp_opt_in: form.whatsapp_opt_in, @@ -132,8 +132,8 @@ export default function MemberProfile() {