diff --git a/apps/api/src/app/admin/admin.service.ts b/apps/api/src/app/admin/admin.service.ts index 9fee59e2c..d86078862 100644 --- a/apps/api/src/app/admin/admin.service.ts +++ b/apps/api/src/app/admin/admin.service.ts @@ -518,6 +518,25 @@ export class AdminService { return response; } + + private async countUsersWithAnalytics(): Promise { + let where: Prisma.UserWhereInput; + + if (this.configurationService.get('ENABLE_FEATURE_SUBSCRIPTION')) { + where = { + NOT: { + Analytics: null + } + }; + } + + const usersCountWithAnalytics = await this.prismaService.user.count({ + where + }); + + return usersCountWithAnalytics; + } + private getExtendedPrismaClient() { Logger.debug('Connect extended prisma client', 'AdminService'); @@ -650,24 +669,6 @@ export class AdminService { return { marketData, count: marketData.length }; } - private async countUsersWithAnalytics(): Promise { - let where: Prisma.UserWhereInput; - - if (this.configurationService.get('ENABLE_FEATURE_SUBSCRIPTION')) { - where = { - NOT: { - Analytics: null - } - }; - } - - const usersCountWithAnalytics = await this.prismaService.user.count({ - where - }); - - return usersCountWithAnalytics; - } - private async getUsersWithAnalytics({ skip, take