Penalty Nachricht im Admin form, abgelaufen für Timebans in tabelle werden Farblich dargestellt

This commit is contained in:
PxlLoewe
2025-07-29 15:54:09 -07:00
parent 99c3024d85
commit 266ff87fd8
7 changed files with 32 additions and 19 deletions

View File

@@ -4,3 +4,4 @@ export * from "./dates";
export * from "./simulatorConnected";
export * from "./useDebounce";
export * from "./useTimeout";
export * from "./penaltys";

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,
};
};