From 80d88608bd041e980f87327876b3502e5cecb640 Mon Sep 17 00:00:00 2001 From: Mayo Date: Fri, 31 Jul 2026 11:56:10 +0200 Subject: [PATCH] Editeted Doc MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Dokumentation über den Funktionen angepasst --- lib/db/song.ts | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/db/song.ts b/lib/db/song.ts index ed55c36..29cc1f4 100644 --- a/lib/db/song.ts +++ b/lib/db/song.ts @@ -6,7 +6,7 @@ import { prisma } from "@/lib/db/prisma"; * GetSongs * Returns all songs * - * @returns {"success": boolean, "songs": [{"id":number, "title": string},...]} + * @returns {"success": boolean, "status": number, "songs": [{"id":number, "title": string},...]} */ export async function getSongs() { try{ @@ -32,7 +32,7 @@ export async function getSongs() { * GetSongById * Returns a song by his ID * @param id - ID indicatin the song - * @returns {"success": boolean, "song": {"id":number, "title": string, "songBooks": [{"songNumber": number, "book": {"title": string, "language": string}},...]}} + * @returns {"success": boolean, "status": number, "song": {"id":number, "title": string, "songBooks": [{"songNumber": number, "book": {"title": string, "language": string}},...]}} */ export async function getSongById(id: number) { try{ @@ -72,7 +72,7 @@ export async function getSongById(id: number) { * * @param query - The search term for the song title. * @param limit - Max number of songs returned for performance (default: 20). - * @returns Object with success state and an array of matching songs. + * @returns @returns {"success": boolean, "status": number, "song": {"id":number, "title": string, "songBooks": [{"songNumber": number, "book": {"title": string, "language": string}},...]}} */ export async function searchSongsByTitle(query: string, limit: number = 20) { try { @@ -117,7 +117,7 @@ export async function searchSongsByTitle(query: string, limit: number = 20) { * CreateSong * Creates an song and returns this song * @param data - object with title - * @returns {"success": boolean, "song": {"id":number, "title": string}} + * @returns {"success": boolean, "status": number, "song": {"id":number, "title": string}} */ export async function createSong(data: { title: string }) { try{ @@ -151,7 +151,7 @@ export async function createSong(data: { title: string }) { * Updates an existing song and returns the updated song * @param id - ID indicatin the song * @param data - object with title - * @returns {"success": boolean, "song": {"id": number, "title": string}} + * @returns {"success": boolean, "status": number, "song": {"id": number, "title": string}} */ export async function updateSong( id: number, @@ -199,7 +199,7 @@ export async function updateSong( * DeleteSong * Deletes an existing song and returns the deleted song * @param id - ID indicatin the song - * @returns {"success": boolean, "song": {"id": number, "title": string}} + * @returns {"success": boolean, "status": number, "song": {"id": number, "title": string}} */ export async function deleteSong(id: number) { try {