From 6b4d9d0c1d5cc107ec506bac00fc530553750217 Mon Sep 17 00:00:00 2001 From: Mateusz Kwasniewski Date: Thu, 6 Jun 2024 13:38:54 +0200 Subject: [PATCH] fix: remove null users in filter (#7308) --- .../project/project-flag-creators-read-model.ts | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/lib/features/project/project-flag-creators-read-model.ts b/src/lib/features/project/project-flag-creators-read-model.ts index f6c8c89f26c7..4d24473cefd5 100644 --- a/src/lib/features/project/project-flag-creators-read-model.ts +++ b/src/lib/features/project/project-flag-creators-read-model.ts @@ -23,9 +23,11 @@ export class ProjectFlagCreatorsReadModel 'users.username', 'users.email', ]); - return result.map((row) => ({ - id: Number(row.id), - name: String(row.name || row.username || row.email), - })); + return result + .filter((row) => row.name || row.username || row.email) + .map((row) => ({ + id: Number(row.id), + name: String(row.name || row.username || row.email), + })); } }