feat: add attachSongToSongbook to db managing.ts

This commit is contained in:
robin committed 2026-07-28 15:32:48 +02:00
1 parent d871bddc99
commit 8910a1ff05
2 files changed
+53 -13

No files matched your search

+35 -11
View File
@@ -117,6 +117,10 @@ export default function AdminPage() {
}
};
const attachSong = async () => {
}
const addSongbook = async () => {
if (!newBookName) {
alert("Der Name des Liederbuches darf nicht leer sein!");
@@ -295,17 +299,37 @@ export default function AdminPage() {
</Card>
<Card title="Aktionen">
<Card title="Zu Liederbuch hinzufügen">
<Input.Select
value={selectedSongbookId}
onChange={(e) => setSelectedSongbookId(e.target.value)}
>
<option value="">-- Bitte wählen --</option>
{songbooks.map((book) => (
<option key={book.id} value={String(book.id)}>
{book.name}{book.language ? ` (${book.language})` : ""}
</option>
))}
</Input.Select>
<div className="space-y-4">
<div>
<Input.Label>Ziel-Liederbuch</Input.Label>
<Input.Select
value={selectedSongbookId}
onChange={(e) => setSelectedSongbookId(e.target.value)}
>
<option value="">-- Bitte wählen --</option>
{songbooks.map((book) => (
<option key={book.id} value={String(book.id)}>
{book.name}{book.language ? ` (${book.language})` : ""}
</option>
))}
</Input.Select>
</div>
<div>
<Input.Label>Nummer</Input.Label>
<Input.Text
type="text"
placeholder="12a"
value={title}
onChange={(e) => setTitle(e.target.value)}
/>
</div>
<Input.Button
onClick={attachSong}
className="w-full mt-6 bg-blue-600 hover:bg-blue-700 text-white font-semibold rounded-lg px-4 py-2.5 transition text-sm shadow-sm"
>
Lied hinzufügen
</Input.Button>
</div>
</Card>
</Card>
</Card>