Files
sign/packages/lib/server-only/admin/get-users-stats.ts

19 lines
418 B
TypeScript
Raw Normal View History

2023-09-08 11:28:50 +03:00
import { prisma } from '@documenso/prisma';
import { SubscriptionStatus } from '@documenso/prisma/client';
export const getUsersCount = async () => {
return await prisma.user.count();
};
export const getUsersWithSubscriptionsCount = async () => {
return await prisma.user.count({
where: {
Subscription: {
some: {
status: SubscriptionStatus.ACTIVE,
},
2023-09-08 11:28:50 +03:00
},
},
});
};