Enrich listProfiles mapping

cgen-1d0e232d7dd4453a814b2558c7e615dc
This commit is contained in:
Builder.io 2025-09-30 22:09:35 +00:00
parent 4c670092e4
commit 37a549f3e7

View file

@ -238,11 +238,17 @@ export const aethexUserService = {
throw error;
}
return (data as any[]).map(
(row) =>
({
...row,
}) as AethexUserProfile,
return Promise.all(
(data as any[]).map(async (row) => {
const profileRow = { ...row } as AethexUserProfile & {
email?: string | null;
};
if (!profileRow.email) {
const mock = await mockAuth.getUserProfile(profileRow.id as any);
if (mock?.email) profileRow.email = mock.email;
}
return profileRow as AethexUserProfile;
}),
);
},