Berechtigungen werden nun beim Verbinden überprüft, Bannen wird nun im Piloten-fenster gelogt
This commit is contained in:
@@ -1,7 +1,10 @@
|
||||
"use server";
|
||||
import { Prisma, prisma } from "@repo/db";
|
||||
|
||||
export const addPenalty = async (data: Prisma.PenaltyCreateInput) => {
|
||||
export const addPenalty = async (
|
||||
data: Prisma.Without<Prisma.PenaltyCreateInput, Prisma.PenaltyUncheckedCreateInput> &
|
||||
Prisma.PenaltyUncheckedCreateInput,
|
||||
) => {
|
||||
return await prisma.penalty.create({
|
||||
data,
|
||||
});
|
||||
|
||||
@@ -7,6 +7,7 @@ import { ColumnDef } from "@tanstack/react-table";
|
||||
import { formatDistance } from "date-fns";
|
||||
import { de } from "date-fns/locale";
|
||||
import { cn } from "../../../../helper/cn";
|
||||
import { HobbyKnifeIcon } from "@radix-ui/react-icons";
|
||||
|
||||
export const penaltyColumns: ColumnDef<Penalty & { Report: Report }>[] = [
|
||||
{
|
||||
@@ -39,10 +40,17 @@ export const penaltyColumns: ColumnDef<Penalty & { Report: Report }>[] = [
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
case "PERMISSIONS_REVOCED":
|
||||
return (
|
||||
<div className={cn("text-error flex gap-3", row.original.suspended && "text-gray-400")}>
|
||||
<LockKeyhole /> Rechte entzogen {row.original.suspended && "(ausgesetzt)"}
|
||||
</div>
|
||||
);
|
||||
case "BAN":
|
||||
return (
|
||||
<div className={cn("text-error flex gap-3", row.original.suspended && "text-gray-400")}>
|
||||
<LockKeyhole /> Bann {row.original.suspended && "(ausgesetzt)"}
|
||||
<HobbyKnifeIcon /> Bann {row.original.suspended && "(ausgesetzt)"}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user