diff --git a/app/admin/ObjekteManager.tsx b/app/admin/ObjekteManager.tsx index b474be4..8c99538 100644 --- a/app/admin/ObjekteManager.tsx +++ b/app/admin/ObjekteManager.tsx @@ -12,7 +12,9 @@ export default function ObjekteManager({ initialObjekte }: Props) { const router = useRouter(); const [editingId, setEditingId] = useState(null); const [editName, setEditName] = useState(''); + const [editKategorie, setEditKategorie] = useState('stern'); const [newName, setNewName] = useState(''); + const [newKategorie, setNewKategorie] = useState('stern'); const [error, setError] = useState(''); const [busy, setBusy] = useState(false); @@ -24,7 +26,7 @@ export default function ObjekteManager({ initialObjekte }: Props) { const res = await fetch('/api/objekte/' + id, { method: 'PUT', headers: { 'Content-Type': 'application/json' }, - body: JSON.stringify({ name: trimmed }), + body: JSON.stringify({ name: trimmed, kategorie: editKategorie }), }); setBusy(false); if (!res.ok) { @@ -59,7 +61,7 @@ export default function ObjekteManager({ initialObjekte }: Props) { const res = await fetch('/api/objekte', { method: 'POST', headers: { 'Content-Type': 'application/json' }, - body: JSON.stringify({ name: trimmed }), + body: JSON.stringify({ name: trimmed, kategorie: newKategorie }), }); setBusy(false); if (!res.ok) { @@ -85,6 +87,15 @@ export default function ObjekteManager({ initialObjekte }: Props) { placeholder="Neues Objekt…" className="flex-1 px-3 py-2 border border-gray-300 rounded-lg text-sm focus:outline-none focus:border-blue-500" /> +