having a bug with api :/

This commit is contained in:
danis
2023-06-28 09:11:49 +02:00
parent a6ae770194
commit b2247e79ae
4 changed files with 43 additions and 6 deletions

View File

@@ -237,6 +237,31 @@ export default class API {
);
}
/**
* @description retrieves songs from a specific artist
* @param artistId is the id of the artist that composed the songs aimed
* @param skip is how much songs do we skip before returning the list
* @param take is how much songs should be returned
* @returns a Promise of Songs type array
*/
public static async getSongsByArtist(artistId: number): Promise<Song[]> {
// let queryString = `/song?artisId=${artistId}`;
// if (skip) {
// queryString = `${queryString}&skip=${skip}`;
// }
// if (take) {
// queryString = `${queryString}&take=${take}`;
// }
// return await API.fetch({
// route: queryString,
// });
return API.fetch({
route: `/song?artistId=${artistId}`,
});
}
/**
* Retrieve a song
* @param songId the id to find the song