From e7174d392c4907e77337967f3ce67c60bbec1767 Mon Sep 17 00:00:00 2001 From: Krao Hasanee Date: Thu, 26 Mar 2026 23:59:21 -0400 Subject: [PATCH] Replace company email with address field Co-Authored-By: Claude Sonnet 4.6 --- src/pages/team/Companies.jsx | 24 ++++++++++++------------ src/pages/team/CompanyDetail.jsx | 6 +++--- supabase/schema.sql | 2 +- 3 files changed, 16 insertions(+), 16 deletions(-) diff --git a/src/pages/team/Companies.jsx b/src/pages/team/Companies.jsx index f46b8e3..0af6362 100644 --- a/src/pages/team/Companies.jsx +++ b/src/pages/team/Companies.jsx @@ -11,7 +11,7 @@ export default function Companies() { const [tasks, setTasks] = useState([]); const [loading, setLoading] = useState(true); const [showNew, setShowNew] = useState(false); - const [newForm, setNewForm] = useState({ name: '', email: '', phone: '' }); + const [newForm, setNewForm] = useState({ name: '', phone: '', address: '' }); const [saving, setSaving] = useState(false); useEffect(() => { @@ -38,8 +38,8 @@ export default function Companies() { setSaving(true); const { data } = await supabase.from('companies').insert({ name: newForm.name.trim(), - email: newForm.email.trim(), phone: newForm.phone.trim(), + address: newForm.address.trim(), }).select().single(); setSaving(false); if (data) { @@ -88,15 +88,6 @@ export default function Companies() { />
-
- - setNewForm(f => ({ ...f, email: e.target.value }))} - /> -
setNewForm(f => ({ ...f, phone: e.target.value }))} />
+
+ + setNewForm(f => ({ ...f, address: e.target.value }))} + /> +
View diff --git a/src/pages/team/CompanyDetail.jsx b/src/pages/team/CompanyDetail.jsx index d1313e2..1db89d9 100644 --- a/src/pages/team/CompanyDetail.jsx +++ b/src/pages/team/CompanyDetail.jsx @@ -110,10 +110,10 @@ export default function CompanyDetail() {
{company.name}
- {company.email && <>{company.email}} - {company.email && company.phone && ' · '} {company.phone && <>{company.phone}} - {!company.email && !company.phone && 'No contact info'} + {company.phone && company.address && ' · '} + {company.address && <>{company.address}} + {!company.phone && !company.address && 'No contact info'}
Company diff --git a/supabase/schema.sql b/supabase/schema.sql index 1e6a601..01ab27c 100755 --- a/supabase/schema.sql +++ b/supabase/schema.sql @@ -7,8 +7,8 @@ create table public.companies ( id uuid default gen_random_uuid() primary key, name text not null, - email text default '', phone text default '', + address text default '', created_at timestamptz default now() not null ); alter table public.companies enable row level security;