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
|
* GetSongs
|
||||||
* Returns all songs
|
* 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() {
|
export async function getSongs() {
|
||||||
try{
|
try{
|
||||||
@@ -32,7 +32,7 @@ export async function getSongs() {
|
|||||||
* GetSongById
|
* GetSongById
|
||||||
* Returns a song by his ID
|
* Returns a song by his ID
|
||||||
* @param id - ID indicatin the song
|
* @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) {
|
export async function getSongById(id: number) {
|
||||||
try{
|
try{
|
||||||
@@ -72,7 +72,7 @@ export async function getSongById(id: number) {
|
|||||||
*
|
*
|
||||||
* @param query - The search term for the song title.
|
* @param query - The search term for the song title.
|
||||||
* @param limit - Max number of songs returned for performance (default: 20).
|
* @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) {
|
export async function searchSongsByTitle(query: string, limit: number = 20) {
|
||||||
try {
|
try {
|
||||||
@@ -117,7 +117,7 @@ export async function searchSongsByTitle(query: string, limit: number = 20) {
|
|||||||
* CreateSong
|
* CreateSong
|
||||||
* Creates an song and returns this song
|
* Creates an song and returns this song
|
||||||
* @param data - object with title
|
* @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 }) {
|
export async function createSong(data: { title: string }) {
|
||||||
try{
|
try{
|
||||||
@@ -151,7 +151,7 @@ export async function createSong(data: { title: string }) {
|
|||||||
* Updates an existing song and returns the updated song
|
* Updates an existing song and returns the updated song
|
||||||
* @param id - ID indicatin the song
|
* @param id - ID indicatin the song
|
||||||
* @param data - object with title
|
* @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(
|
export async function updateSong(
|
||||||
id: number,
|
id: number,
|
||||||
@@ -199,7 +199,7 @@ export async function updateSong(
|
|||||||
* DeleteSong
|
* DeleteSong
|
||||||
* Deletes an existing song and returns the deleted song
|
* Deletes an existing song and returns the deleted song
|
||||||
* @param id - ID indicatin the 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) {
|
export async function deleteSong(id: number) {
|
||||||
try {
|
try {
|
||||||
|
|||||||
Reference in new issue
Block a user