From ed0d97bb4bfc0c633d597cc9230588e9a5e31e74 Mon Sep 17 00:00:00 2001 From: "gpt-engineer-app[bot]" <159125892+gpt-engineer-app[bot]@users.noreply.github.com> Date: Sun, 21 Dec 2025 15:38:22 +0000 Subject: [PATCH] Changes --- src/components/reviews/ProductReviews.tsx | 6 +++--- src/components/reviews/TestimonialsSection.tsx | 6 +++--- src/pages/admin/AdminConsulting.tsx | 16 ++++++++-------- src/pages/admin/AdminMembers.tsx | 6 +++--- src/pages/admin/AdminReviews.tsx | 8 ++++---- src/pages/member/MemberProfile.tsx | 12 ++++++------ 6 files changed, 27 insertions(+), 27 deletions(-) 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 => (
- {slot.start_time.substring(0, 5)} - {slot.profiles?.full_name || 'N/A'} ({slot.topic_category}) + {slot.start_time.substring(0, 5)} - {slot.profiles?.name || 'N/A'} ({slot.topic_category}) {slot.meet_link ? ( @@ -334,7 +334,7 @@ export default function AdminConsulting() {
-

{slot.profiles?.full_name || '-'}

+

{slot.profiles?.name || '-'}

{slot.profiles?.email}

@@ -425,7 +425,7 @@ export default function AdminConsulting() { {format(parseISO(slot.date), 'd MMM yyyy', { locale: id })} {slot.start_time.substring(0, 5)} - {slot.end_time.substring(0, 5)} - {slot.profiles?.full_name || '-'} + {slot.profiles?.name || '-'} {slot.topic_category} @@ -462,7 +462,7 @@ export default function AdminConsulting() {

Tanggal: {format(parseISO(selectedSlot.date), 'd MMMM yyyy', { locale: id })}

Waktu: {selectedSlot.start_time.substring(0, 5)} - {selectedSlot.end_time.substring(0, 5)}

-

Klien: {selectedSlot.profiles?.full_name}

+

Klien: {selectedSlot.profiles?.name}

Topik: {selectedSlot.topic_category}

{selectedSlot.notes &&

Catatan: {selectedSlot.notes}

}
diff --git a/src/pages/admin/AdminMembers.tsx b/src/pages/admin/AdminMembers.tsx index d9254d0..85e83f2 100644 --- a/src/pages/admin/AdminMembers.tsx +++ b/src/pages/admin/AdminMembers.tsx @@ -16,7 +16,7 @@ import { toast } from "@/hooks/use-toast"; interface Member { id: string; email: string | null; - full_name: string | null; + name: string | null; created_at: string; isAdmin?: boolean; } @@ -118,7 +118,7 @@ export default function AdminMembers() { {members.map((member) => ( {member.email || "-"} - {member.full_name || "-"} + {member.name || "-"} {adminIds.has(member.id) ? ( Admin @@ -166,7 +166,7 @@ export default function AdminMembers() { Email: {selectedMember.email}

- Nama: {selectedMember.full_name || "-"} + Nama: {selectedMember.name || "-"}

ID: {selectedMember.id} diff --git a/src/pages/admin/AdminReviews.tsx b/src/pages/admin/AdminReviews.tsx index 8324e66..75e6668 100644 --- a/src/pages/admin/AdminReviews.tsx +++ b/src/pages/admin/AdminReviews.tsx @@ -23,7 +23,7 @@ interface Review { body: string; is_approved: boolean; created_at: string; - profiles: { full_name: string | null; email: string | null } | null; + profiles: { name: string | null; email: string | null } | null; products: { title: string } | null; } @@ -44,7 +44,7 @@ export default function AdminReviews() { .from("reviews") .select(` *, - profiles:user_id (full_name, email), + profiles:user_id (name, email), products:product_id (title) `) .order("created_at", { ascending: false }); @@ -224,7 +224,7 @@ export default function AdminReviews() {

{review.title}

{review.body &&

{review.body}

}
- {review.profiles?.full_name || review.profiles?.email || "Unknown"} + {review.profiles?.name || review.profiles?.email || "Unknown"} {review.products && • {review.products.title}} • {new Date(review.created_at).toLocaleDateString("id-ID")}
@@ -300,7 +300,7 @@ export default function AdminReviews() {

{review.title}

{review.body &&

{review.body}

}
- {review.profiles?.full_name || review.profiles?.email} + {review.profiles?.name || review.profiles?.email} {review.products && • {review.products.title}}
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() {
setForm({ ...form, full_name: e.target.value })} + value={form.name} + onChange={(e) => setForm({ ...form, name: e.target.value })} className="border-2" placeholder="Masukkan nama lengkap" />