fix: stat should not count user with system role

This commit is contained in:
Methapon Metanipat 2024-08-16 18:00:53 +07:00
parent bae9615bd8
commit a028d8f9b3

View file

@ -172,6 +172,11 @@ export class UserController extends Controller {
const list = await prisma.user.groupBy({
by: "userType",
_count: true,
where: {
AND: {
userRole: { not: "system" },
},
},
});
return list.reduce<Record<UserType, number>>(