diff --git a/apps/dispatch/app/_components/navbar/AdminPanel.tsx b/apps/dispatch/app/_components/navbar/AdminPanel.tsx
index d5109957..f13649b3 100644
--- a/apps/dispatch/app/_components/navbar/AdminPanel.tsx
+++ b/apps/dispatch/app/_components/navbar/AdminPanel.tsx
@@ -154,9 +154,11 @@ export default function AdminPanel() {
btnClassName="btn-warning"
btnTip="Die Verbindung zur Leitstelle wird für diesesn Nutzer unterbrochen"
Icon={}
- 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 });
+ }}
/>
}
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={}
- 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,
+ });
+ }}
/>