feat: Objekte-Kategorien (stern/sonne/beide) — Version 1.10.1

- Neue Spalte Kategorie (SET stern/sonne) in objekte-Tabelle
- ObjektSelector zeigt je nach ArtFuehrung nur passende Objekte
- SonnenFührung: Sonne fest vorausgewählt, zusätzliche Sonne-Objekte wählbar
- Bestehende Objekte erhalten Kategorie automatisch beim Speichern
- Admin: Kategorie editierbar (stern / sonne / stern,sonne)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-06-14 16:14:52 +02:00
parent 96ba03b909
commit 7475d4fd37
8 changed files with 92 additions and 42 deletions
+4 -2
View File
@@ -10,10 +10,12 @@ export async function PUT(req: NextRequest, { params }: { params: Promise<{ id:
const { id } = await params;
const numId = Number(id);
if (isNaN(numId)) return NextResponse.json({ error: 'Ungültige ID' }, { status: 400 });
const { name } = await req.json();
const { name, kategorie } = await req.json();
const trimmed = (name as string)?.trim();
if (!trimmed) return NextResponse.json({ error: 'Name darf nicht leer sein' }, { status: 400 });
const result = await phpdb.updateObjekt(numId, trimmed);
const VALID = ['stern', 'sonne', 'stern,sonne'];
const kat: string | undefined = VALID.includes(kategorie) ? kategorie : undefined;
const result = await phpdb.updateObjekt(numId, trimmed, kat);
return NextResponse.json(result);
} catch (error) {
console.error('PUT /api/objekte/[id]:', error);