From 5908a791f207f06178906bf60e427c47fb8773eb Mon Sep 17 00:00:00 2001 From: Adria Navarro Date: Wed, 11 Oct 2023 19:10:58 +0200 Subject: [PATCH] Return email and names on bb reference api output --- packages/server/src/api/routes/tests/row.spec.ts | 3 +++ .../src/utilities/rowProcessor/bbReferenceProcessor.ts | 3 +++ .../rowProcessor/tests/bbReferenceProcessor.spec.ts | 6 ++++++ 3 files changed, 12 insertions(+) diff --git a/packages/server/src/api/routes/tests/row.spec.ts b/packages/server/src/api/routes/tests/row.spec.ts index 4b1bc65793..0a80253210 100644 --- a/packages/server/src/api/routes/tests/row.spec.ts +++ b/packages/server/src/api/routes/tests/row.spec.ts @@ -1580,6 +1580,9 @@ describe.each([ (row: Row) => ({ _id: row._id, primaryDisplay: row.email, + email: row.email, + firstName: row.firstName, + lastName: row.lastName, }), ], ])("links - %s", (__, relSchema, dataGenerator, resultMapper) => { diff --git a/packages/server/src/utilities/rowProcessor/bbReferenceProcessor.ts b/packages/server/src/utilities/rowProcessor/bbReferenceProcessor.ts index c126530b8d..c7b8998bad 100644 --- a/packages/server/src/utilities/rowProcessor/bbReferenceProcessor.ts +++ b/packages/server/src/utilities/rowProcessor/bbReferenceProcessor.ts @@ -82,6 +82,9 @@ export async function processOutputBBReferences( return users.map(u => ({ _id: u._id, primaryDisplay: u.email, + email: u.email, + firstName: u.firstName, + lastName: u.lastName, })) default: diff --git a/packages/server/src/utilities/rowProcessor/tests/bbReferenceProcessor.spec.ts b/packages/server/src/utilities/rowProcessor/tests/bbReferenceProcessor.spec.ts index 10d339f6b4..b6174861d4 100644 --- a/packages/server/src/utilities/rowProcessor/tests/bbReferenceProcessor.spec.ts +++ b/packages/server/src/utilities/rowProcessor/tests/bbReferenceProcessor.spec.ts @@ -180,6 +180,9 @@ describe("bbReferenceProcessor", () => { { _id: user._id, primaryDisplay: user.email, + email: user.email, + firstName: user.firstName, + lastName: user.lastName, }, ]) expect(cacheGetUsersSpy).toBeCalledTimes(1) @@ -204,6 +207,9 @@ describe("bbReferenceProcessor", () => { [user1, user2].map(u => ({ _id: u._id, primaryDisplay: u.email, + email: u.email, + firstName: u.firstName, + lastName: u.lastName, })) ) )