feat: Admin API users manegement endpoints

This commit is contained in:
Agusti Fernandez Pardo committed 2022-05-31 18:33:01 +02:00
1 parent ed2f42fb01
commit 9459b9048d
4 files changed
+70 -32

No files matched your search

+6
View File
@@ -0,0 +1,6 @@
import prisma from "@calcom/prisma";
export const isAdminGuard = async (userId: number) => {
const user = await prisma.user.findUnique({ where: { id: userId } });
return user?.role === "ADMIN";
};