1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-01-25 00:07:47 +01:00

feat: able to search by description (#5392)

This commit is contained in:
Jaanus Sellin 2023-11-22 14:08:52 +02:00 committed by GitHub
parent 5dc3e830a8
commit 68558fc774
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 17 additions and 0 deletions

View File

@ -487,3 +487,16 @@ test('should not return duplicate entries when sorting by last seen', async () =
total: 3,
});
});
test('should search features by description', async () => {
const description = 'secretdescription';
await app.createFeature('my_feature_a');
await app.createFeature({ name: 'my_feature_b', description });
const { body } = await searchFeatures({
query: 'descr',
});
expect(body).toMatchObject({
features: [{ name: 'my_feature_b', description }],
});
});

View File

@ -590,6 +590,10 @@ class FeatureStrategiesStore implements IFeatureStrategiesStore {
query.where((builder) => {
builder
.whereILike('features.name', `%${queryString}%`)
.orWhereILike(
'features.description',
`%${queryString}%`,
)
.orWhereIn('features.name', tagQuery);
});
}