1
0
mirror of https://github.com/Fayorg/calendrier-avant.git synced 2026-05-28 01:28:37 +02:00

add: dashboard tabs

This commit is contained in:
2023-12-20 19:36:52 +01:00
parent 8b32c62754
commit ef45d7eac7
7 changed files with 131 additions and 38 deletions

26
actions/accounts.ts Normal file
View File

@@ -0,0 +1,26 @@
"use server";
import prisma from "@/lib/prisma";
import { Users } from "@prisma/client";
interface GetAccountsParameters {
take?: number;
skip?: number;
}
export async function getAccounts(args?: GetAccountsParameters): Promise<Pick<Users, "id" | "firstName" | "lastName" | "isAdmin" | "isTeacher">[]> {
return await prisma.users.findMany({
take: args?.take,
skip: args?.skip,
orderBy: {
id: "asc",
},
select: {
id: true,
firstName: true,
lastName: true,
isAdmin: true,
isTeacher: true,
}
});
}