From 8279da9f9ba7a97ca750814991d3d2168cf1d1f2 Mon Sep 17 00:00:00 2001 From: Mateusz Kwasniewski Date: Thu, 6 Jun 2024 14:50:38 +0200 Subject: [PATCH] feat: show creators from non archived features (#7309) --- .../features/project/project-flag-creators-read-model.ts | 1 + src/lib/features/project/project-flag-creators.e2e.test.ts | 6 ++---- 2 files changed, 3 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 4d24473cefd5..95c64aa0c8c5 100644 --- a/src/lib/features/project/project-flag-creators-read-model.ts +++ b/src/lib/features/project/project-flag-creators-read-model.ts @@ -17,6 +17,7 @@ export class ProjectFlagCreatorsReadModel .distinct('users.id') .join('features', 'users.id', '=', 'features.created_by_user_id') .where('features.project', project) + .where('features.archived_at', null) .select([ 'users.id', 'users.name', diff --git a/src/lib/features/project/project-flag-creators.e2e.test.ts b/src/lib/features/project/project-flag-creators.e2e.test.ts index 23ce401c762e..115976fc6f75 100644 --- a/src/lib/features/project/project-flag-creators.e2e.test.ts +++ b/src/lib/features/project/project-flag-creators.e2e.test.ts @@ -48,14 +48,12 @@ test('should return flag creators', async () => { }) .expect(200); await app.createFeature('flag-name-2'); + await app.archiveFeature('flag-name-2'); const { body } = await app.request .get('/api/admin/projects/default/flag-creators') .expect('Content-Type', /json/) .expect(200); - expect(body).toEqual([ - { id: 1, name: 'user1@getunleash.io' }, - { id: 2, name: 'user2@getunleash.io' }, - ]); + expect(body).toEqual([{ id: 1, name: 'user1@getunleash.io' }]); });