Zeitstreafen werden nun beim Verbinden überprüft

This commit is contained in:
PxlLoewe
2025-07-29 12:34:55 -07:00
parent fd50e9c4d5
commit 1bdccc46fe
3 changed files with 58 additions and 2 deletions

View File

@@ -0,0 +1,32 @@
import { prisma } from "@repo/db";
export const getUserPenaltys = async (userId: string) => {
const openTimeban = await prisma.penalty.findMany({
where: {
userId: userId,
until: {
gte: new Date(),
},
suspended: false,
type: "TIME_BAN",
},
include: {
CreatedUser: true,
},
});
const openBans = await prisma.penalty.findMany({
where: {
userId: userId,
suspended: false,
type: "BAN",
},
include: {
CreatedUser: true,
},
});
return {
openTimeban,
openBans,
};
};