2022-08-28 06:38:35 +02:00
|
|
|
import prisma from 'lib/prisma';
|
2022-07-12 23:14:36 +02:00
|
|
|
|
|
|
|
export async function getAccounts() {
|
2022-08-28 06:38:35 +02:00
|
|
|
return prisma.client.account.findMany({
|
|
|
|
orderBy: [
|
2022-10-10 22:42:18 +02:00
|
|
|
{ isAdmin: 'desc' },
|
2022-08-28 06:38:35 +02:00
|
|
|
{
|
|
|
|
username: 'asc',
|
2022-07-12 23:14:36 +02:00
|
|
|
},
|
2022-08-28 06:38:35 +02:00
|
|
|
],
|
|
|
|
select: {
|
2022-10-10 22:42:18 +02:00
|
|
|
id: true,
|
2022-08-28 06:38:35 +02:00
|
|
|
username: true,
|
2022-10-10 22:42:18 +02:00
|
|
|
isAdmin: true,
|
|
|
|
createdAt: true,
|
|
|
|
updatedAt: true,
|
2022-08-28 06:38:35 +02:00
|
|
|
},
|
|
|
|
});
|
2022-07-12 23:14:36 +02:00
|
|
|
}
|