From 37a549f3e7574c0916190583ba99afe0aaa25392 Mon Sep 17 00:00:00 2001 From: "Builder.io" Date: Tue, 30 Sep 2025 22:09:35 +0000 Subject: [PATCH] Enrich listProfiles mapping cgen-1d0e232d7dd4453a814b2558c7e615dc --- client/lib/aethex-database-adapter.ts | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/client/lib/aethex-database-adapter.ts b/client/lib/aethex-database-adapter.ts index eebe20a2..4a6434a5 100644 --- a/client/lib/aethex-database-adapter.ts +++ b/client/lib/aethex-database-adapter.ts @@ -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; + }), ); },