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:
parent
5dc3e830a8
commit
68558fc774
@ -487,3 +487,16 @@ test('should not return duplicate entries when sorting by last seen', async () =
|
|||||||
total: 3,
|
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 }],
|
||||||
|
});
|
||||||
|
});
|
||||||
|
@ -590,6 +590,10 @@ class FeatureStrategiesStore implements IFeatureStrategiesStore {
|
|||||||
query.where((builder) => {
|
query.where((builder) => {
|
||||||
builder
|
builder
|
||||||
.whereILike('features.name', `%${queryString}%`)
|
.whereILike('features.name', `%${queryString}%`)
|
||||||
|
.orWhereILike(
|
||||||
|
'features.description',
|
||||||
|
`%${queryString}%`,
|
||||||
|
)
|
||||||
.orWhereIn('features.name', tagQuery);
|
.orWhereIn('features.name', tagQuery);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user