Zeitstreafen werden nun beim Verbinden überprüft
This commit is contained in:
32
apps/dispatch-server/helper.ts
Normal file
32
apps/dispatch-server/helper.ts
Normal 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,
|
||||
};
|
||||
};
|
||||
Reference in New Issue
Block a user