mirror of
https://github.com/Unleash/unleash.git
synced 2025-07-31 13:47:02 +02:00
fix: compilation issues from event-store (#3568)
## About the changes Reduce compilation errors on event-store
This commit is contained in:
parent
b1d73ba47c
commit
551c00b6b2
@ -109,6 +109,9 @@ class EventStore implements IEventStore {
|
|||||||
let count = await this.db(TABLE)
|
let count = await this.db(TABLE)
|
||||||
.count<Record<string, number>>()
|
.count<Record<string, number>>()
|
||||||
.first();
|
.first();
|
||||||
|
if (!count) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
if (typeof count.count === 'string') {
|
if (typeof count.count === 'string') {
|
||||||
return parseInt(count.count, 10);
|
return parseInt(count.count, 10);
|
||||||
} else {
|
} else {
|
||||||
@ -128,6 +131,9 @@ class EventStore implements IEventStore {
|
|||||||
query = query.andWhere({ feature_name: eventSearch.feature });
|
query = query.andWhere({ feature_name: eventSearch.feature });
|
||||||
}
|
}
|
||||||
let count = await query.count().first();
|
let count = await query.count().first();
|
||||||
|
if (!count) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
if (typeof count.count === 'string') {
|
if (typeof count.count === 'string') {
|
||||||
return parseInt(count.count, 10);
|
return parseInt(count.count, 10);
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
Reference in New Issue
Block a user