feat(me): inline profile editing in the Profile tab (P3b)
Wires existing updateMyProfile + discloseAffiliations into an editable form (name, handle, phone, bio, skills, interests, willing-to, affiliations). Affiliations re-disclosed only when changed so the COI timestamp is not reset on every save. Added bio to the updateMyProfile param type (schema + column already supported it). 521 tests; build clean (UI not browser-tested from here).
This commit is contained in:
+15
-1
@@ -24,12 +24,25 @@ export default async function MePage() {
|
||||
|
||||
const { data: member } = await supabase
|
||||
.from('space_members')
|
||||
.select('id, space_id, role, display_name')
|
||||
.select(
|
||||
'id, space_id, role, display_name, handle, phone, bio, skills, interests, willing_to, affiliations',
|
||||
)
|
||||
.eq('user_id', user.id)
|
||||
.in('status', ['current', 'unverified', 'late'])
|
||||
.maybeSingle()
|
||||
if (!member) redirect('/signup')
|
||||
|
||||
const profile = {
|
||||
display_name: (member.display_name as string | null) ?? '',
|
||||
handle: (member.handle as string | null) ?? '',
|
||||
phone: (member.phone as string | null) ?? '',
|
||||
bio: (member.bio as string | null) ?? '',
|
||||
skills: (member.skills as string[] | null) ?? [],
|
||||
interests: (member.interests as string[] | null) ?? [],
|
||||
willing_to: (member.willing_to as string[] | null) ?? [],
|
||||
affiliations: (member.affiliations as string[] | null) ?? [],
|
||||
}
|
||||
|
||||
const { data: grantsRaw } = await supabase
|
||||
.from('member_certifications')
|
||||
.select(
|
||||
@@ -91,6 +104,7 @@ export default async function MePage() {
|
||||
</PageHeader>
|
||||
|
||||
<MePortalClient
|
||||
profile={profile}
|
||||
grants={grants}
|
||||
held={held}
|
||||
billing={billing}
|
||||
|
||||
Reference in New Issue
Block a user