Update user service to work with existing database structure
cgen-06b007030c664654bfa74178ccd60caa
This commit is contained in:
parent
e0f939c4e5
commit
8f3f762bcf
1 changed files with 9 additions and 1 deletions
|
|
@ -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(
|
||||
|
|
|
|||
Loading…
Reference in a new issue