mirror of
https://github.com/Unleash/unleash.git
synced 2025-09-24 17:51:14 +02:00
chore: unknown flags should not include flags that exist in Unleash
This commit is contained in:
parent
709a890bd8
commit
a5e543c1dd
@ -66,18 +66,24 @@ export class UnknownFlagsStore implements IUnknownFlagsStore {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async getAll({ limit, orderBy }: QueryParams = {}): Promise<UnknownFlag[]> {
|
async getAll({ limit, orderBy }: QueryParams = {}): Promise<UnknownFlag[]> {
|
||||||
let query = this.db(`${TABLE} AS uf`).select(
|
let query = this.db(`${TABLE} AS uf`)
|
||||||
'uf.name',
|
.select(
|
||||||
'uf.app_name',
|
'uf.name',
|
||||||
'uf.seen_at',
|
'uf.app_name',
|
||||||
'uf.environment',
|
'uf.seen_at',
|
||||||
this.db.raw(
|
'uf.environment',
|
||||||
`(SELECT MAX(e.created_at)
|
this.db.raw(
|
||||||
|
`(SELECT MAX(e.created_at)
|
||||||
FROM ${TABLE_EVENTS} AS e
|
FROM ${TABLE_EVENTS} AS e
|
||||||
WHERE e.feature_name = uf.name)
|
WHERE e.feature_name = uf.name)
|
||||||
AS last_event_at`,
|
AS last_event_at`,
|
||||||
),
|
),
|
||||||
);
|
)
|
||||||
|
.whereNotExists(
|
||||||
|
this.db('features as f')
|
||||||
|
.select(this.db.raw('1'))
|
||||||
|
.whereRaw('f.name = uf.name'),
|
||||||
|
);
|
||||||
|
|
||||||
if (orderBy) {
|
if (orderBy) {
|
||||||
query = query.orderBy(orderBy);
|
query = query.orderBy(orderBy);
|
||||||
|
Loading…
Reference in New Issue
Block a user