Kicks benötigen nun immer eine Begründung

This commit is contained in:
PxlLoewe
2025-06-27 15:58:57 -07:00
parent ae8d8e0888
commit 92aba03aff

View File

@@ -154,9 +154,11 @@ export default function AdminPanel() {
btnClassName="btn-warning"
btnTip="Die Verbindung zur Leitstelle wird für diesesn Nutzer unterbrochen"
Icon={<RedoDot size={15} />}
onClick={({ reason }) =>
kickPilotMutation.mutate({ id: p.id, reason })
}
onClick={({ reason }) => {
if (!reason.length)
return toast.error("Bitte gib einen Grund für die Strafe an.");
kickPilotMutation.mutate({ id: p.id, reason });
}}
/>
<PenaltyDropdown
btnName="Kick + Berechtigungen entfernen"
@@ -165,6 +167,8 @@ export default function AdminPanel() {
showDatePicker
Icon={<LockKeyhole size={15} />}
onClick={({ reason, until }) => {
if (!reason.length)
return toast.error("Bitte gib einen Grund für die Strafe an.");
if (!until) {
toast.error(
"Bitte wähle ein Datum aus. Ein permanenter Bann ist nur vom HUB aus möglich.",
@@ -225,9 +229,22 @@ export default function AdminPanel() {
btnTip="Dadurch wird sich der Pilot nicht mehr mit dem VAR verbinden können."
showDatePicker
Icon={<LockKeyhole size={15} />}
onClick={({ reason, until }) =>
kickDispatchMutation.mutate({ id: d.id, reason, bann: true, until })
onClick={({ reason, until }) => {
if (!reason.length)
return toast.error("Bitte gib einen Grund für die Strafe an.");
if (!until) {
toast.error(
"Bitte wähle ein Datum aus. Ein permanenter Bann ist nur vom HUB aus möglich.",
);
return;
}
kickDispatchMutation.mutate({
id: d.id,
reason,
bann: true,
until,
});
}}
/>
<a
href={`${process.env.NEXT_PUBLIC_HUB_URL}/admin/user/${d.userId}`}