1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-02-23 00:22:19 +01:00

fix: compilation issues from event-store (#3568)

## About the changes
Reduce compilation errors on event-store
This commit is contained in:
Gastón Fournier 2023-04-20 11:37:38 +02:00 committed by GitHub
parent b1d73ba47c
commit 551c00b6b2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -109,6 +109,9 @@ class EventStore implements IEventStore {
let count = await this.db(TABLE)
.count<Record<string, number>>()
.first();
if (!count) {
return 0;
}
if (typeof count.count === 'string') {
return parseInt(count.count, 10);
} else {
@ -128,6 +131,9 @@ class EventStore implements IEventStore {
query = query.andWhere({ feature_name: eventSearch.feature });
}
let count = await query.count().first();
if (!count) {
return 0;
}
if (typeof count.count === 'string') {
return parseInt(count.count, 10);
} else {