Editeted Doc
Dokumentation über den Funktionen angepasst
This commit is contained in:
1 parent
4380669fa3
commit
80d88608bd
1 file changed
+6
-6
+6
-6
@@ -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 {
|
||||
|
||||
Reference in new issue
Block a user