Enrich listProfiles mapping
cgen-1d0e232d7dd4453a814b2558c7e615dc
This commit is contained in:
parent
4c670092e4
commit
37a549f3e7
1 changed files with 11 additions and 5 deletions
|
|
@ -238,11 +238,17 @@ export const aethexUserService = {
|
||||||
throw error;
|
throw error;
|
||||||
}
|
}
|
||||||
|
|
||||||
return (data as any[]).map(
|
return Promise.all(
|
||||||
(row) =>
|
(data as any[]).map(async (row) => {
|
||||||
({
|
const profileRow = { ...row } as AethexUserProfile & {
|
||||||
...row,
|
email?: string | null;
|
||||||
}) as AethexUserProfile,
|
};
|
||||||
|
if (!profileRow.email) {
|
||||||
|
const mock = await mockAuth.getUserProfile(profileRow.id as any);
|
||||||
|
if (mock?.email) profileRow.email = mock.email;
|
||||||
|
}
|
||||||
|
return profileRow as AethexUserProfile;
|
||||||
|
}),
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue