From c34d5d95295c1e6de26233c88f930f138735f54d Mon Sep 17 00:00:00 2001 From: v0 Date: Wed, 11 Mar 2026 08:05:53 +0000 Subject: [PATCH] fix: correct Supabase insert fields for secrets and area leads Fix missing 'label' in secrets insert and correct area leads field names. Co-authored-by: Moheeb Zara <1184415+virgilvox@users.noreply.github.com> --- app/(app)/ops/ops-client.tsx | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/app/(app)/ops/ops-client.tsx b/app/(app)/ops/ops-client.tsx index 41b78b0..9b36f8d 100644 --- a/app/(app)/ops/ops-client.tsx +++ b/app/(app)/ops/ops-client.tsx @@ -25,9 +25,9 @@ interface KbEntry { interface AreaLead { id: string area_name: string - member_name: string - member_id?: string - contact_info?: string + lead_handle: string + lead_id?: string + description?: string } interface Secret { @@ -225,6 +225,7 @@ function AddSecretModal({ const { data, error } = await supabase.from('secrets').insert({ space_id: spaceId, title: title.trim(), + label: title.trim(), area: area.trim() || null, value: value.trim(), }).select('id, title, area, created_at').single() @@ -299,8 +300,8 @@ function AreaLeadModal({ }) { const isEdit = !!lead const [areaName, setAreaName] = useState(lead?.area_name ?? '') - const [memberName, setMemberName] = useState(lead?.member_name ?? '') - const [contactInfo, setContactInfo] = useState(lead?.contact_info ?? '') + const [memberName, setMemberName] = useState(lead?.lead_handle ?? '') + const [contactInfo, setContactInfo] = useState(lead?.description ?? '') const [saving, setSaving] = useState(false) async function handleSave(e: React.FormEvent) { @@ -312,15 +313,15 @@ function AreaLeadModal({ if (isEdit) { result = await supabase.from('area_leads').update({ area_name: areaName.trim(), - member_name: memberName.trim(), - contact_info: contactInfo.trim() || null, + lead_handle: memberName.trim(), + description: contactInfo.trim() || null, }).eq('id', lead.id).select('*').single() } else { result = await supabase.from('area_leads').insert({ space_id: spaceId, area_name: areaName.trim(), - member_name: memberName.trim(), - contact_info: contactInfo.trim() || null, + lead_handle: memberName.trim(), + description: contactInfo.trim() || null, }).select('*').single() } setSaving(false) @@ -717,9 +718,9 @@ export function OpsClient({ member, spaceId, kbEntries: initial, areaLeads: init

{lead.area_name}

-

{lead.member_name}

- {lead.contact_info && ( -

{lead.contact_info}

+

{lead.lead_handle}

+ {lead.description && ( +

{lead.description}

)}