From 8f3f762bcfe906581828c4dc6636c117c229a205 Mon Sep 17 00:00:00 2001 From: "Builder.io" Date: Sun, 17 Aug 2025 00:13:53 +0000 Subject: [PATCH] Update user service to work with existing database structure cgen-06b007030c664654bfa74178ccd60caa --- client/lib/aethex-database-adapter.ts | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/client/lib/aethex-database-adapter.ts b/client/lib/aethex-database-adapter.ts index 2747d07f..0b64d934 100644 --- a/client/lib/aethex-database-adapter.ts +++ b/client/lib/aethex-database-adapter.ts @@ -72,7 +72,15 @@ export const aethexUserService = { return null; } - return data as AethexUserProfile; + // Map the existing database fields to our interface + return { + ...data, + email: user.email, + username: data.username || user.email?.split('@')[0] || 'user', + onboarded: true, // Assume existing users are onboarded + role: 'member', // Default role + loyalty_points: 0, // Default value + } as AethexUserProfile; }, async updateProfile(