Basic pagination en Artistas

This commit is contained in:
Daniel Cortes
2020-06-06 06:47:21 -04:00
parent e08e75538d
commit 2f3e83f8c8
3 changed files with 118 additions and 57 deletions

View File

@@ -8,8 +8,8 @@ export async function getArtist(mbid) {
return response.data
}
export async function getArtistDiscs(mbid, per_page=10) {
const url = `${baseUrl}/artist/${mbid}/discs?per_page=${per_page}`;
export async function getArtistDiscs(mbid, page = 1, per_page=10) {
const url = `${baseUrl}/artist/${mbid}/discs?per_page=${per_page}&page=${page}`;
const response = await axios.get(url);
return response.data
}