umami/queries/admin/user/getUsers.js
2022-10-31 23:42:37 -07:00

19 lines
310 B
JavaScript

import prisma from 'lib/prisma';
export async function getUsers() {
return prisma.client.user.findMany({
orderBy: [
{ isAdmin: 'desc' },
{
username: 'asc',
},
],
select: {
id: true,
username: true,
isAdmin: true,
createdAt: true,
},
});
}