Feat/admin options #14

Merged
robin merged 20 commits from feat/admin-options into main 2026-07-28 15:05:03 +00:00
Showing only changes of commit 57ea3907b6 - Show all commits
+14
View File
@@ -146,6 +146,20 @@ export async function attachSongToSongbook(songId: number, songbookId: number, n
} }
} }
export async function removeSongfromSongbook(songId: number, songbookId: number) {
try {
const info = db.prepare(`
DELETE FROM songbook_songs
WHERE songbook_id = ? AND song_id = ?
`).run(songbookId, songId);
return { success: info.changes > 0 };
} catch (error) {
console.error("Error in removeSongfromSongbook:", error);
return { success: false };
}
}
export async function getSongbooks() { export async function getSongbooks() {
try { try {
const songbooks = db.prepare('SELECT id, name, language FROM songbooks ORDER BY name ASC').all(); const songbooks = db.prepare('SELECT id, name, language FROM songbooks ORDER BY name ASC').all();