diff --git a/src/lib/db/feature-toggle-store.ts b/src/lib/db/feature-toggle-store.ts index 041c6d5a00..fd37322acf 100644 --- a/src/lib/db/feature-toggle-store.ts +++ b/src/lib/db/feature-toggle-store.ts @@ -105,9 +105,7 @@ export default class FeatureToggleStore implements IFeatureToggleStore { async getAllByNames(names: string[]): Promise { const query = this.db(TABLE).orderBy('name', 'asc'); - if (names.length > 0) { - query.whereIn('name', names); - } + query.whereIn('name', names); const rows = await query; return rows.map(this.rowToFeature); } diff --git a/src/test/e2e/api/admin/export-import.e2e.test.ts b/src/test/e2e/api/admin/export-import.e2e.test.ts index cfb87ff2d7..8adc4647d7 100644 --- a/src/test/e2e/api/admin/export-import.e2e.test.ts +++ b/src/test/e2e/api/admin/export-import.e2e.test.ts @@ -290,7 +290,7 @@ test('should export tags', async () => { }); }); -test('returns all features, when no feature was defined', async () => { +test('returns no features, when no feature was requested', async () => { await createProject('default', 'default'); await createToggle({ name: 'first_feature', @@ -309,5 +309,5 @@ test('returns all features, when no feature was defined', async () => { .set('Content-Type', 'application/json') .expect(200); - expect(body.features).toHaveLength(2); + expect(body.features).toHaveLength(0); });