fix(auth): counting active subscriptions

This commit is contained in:
Karol Sójko
2022-10-03 10:38:31 +02:00
parent fdf8809e13
commit e7736bba25
2 changed files with 3 additions and 6 deletions
@@ -19,9 +19,8 @@ export class MySQLUserSubscriptionRepository implements UserSubscriptionReposito
async countActiveSubscriptions(): Promise<number> {
return await this.ormRepository
.createQueryBuilder()
.select('user_uuid')
.distinct()
.where('ends_at > :timestamp', { timestamp: this.timer.getTimestampInMicroseconds() })
.groupBy('user_uuid')
.getCount()
}