feat(FE): playlist, get content
This commit is contained in:
parent
25e4c44b81
commit
bcde31e673
1 changed files with 11 additions and 1 deletions
|
@ -48,7 +48,7 @@ export const getPlaylist = async (options: {
|
||||||
page?: Number | null;
|
page?: Number | null;
|
||||||
per_page?: Number | null;
|
per_page?: Number | null;
|
||||||
all?: string | null;
|
all?: string | null;
|
||||||
}): Promise<Show[]> => {
|
}): Promise<any> => {
|
||||||
const filteredParams = cleanOptions(options);
|
const filteredParams = cleanOptions(options);
|
||||||
return await axios.get(`/playlist`, {params: filteredParams})
|
return await axios.get(`/playlist`, {params: filteredParams})
|
||||||
.then((response: AxiosResponse) => {
|
.then((response: AxiosResponse) => {
|
||||||
|
@ -57,3 +57,13 @@ export const getPlaylist = async (options: {
|
||||||
console.log("Error: " + error);
|
console.log("Error: " + error);
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TODO playlist interface
|
||||||
|
export const getPlaylistContent = async (playlistId: Number): Promise<any> => {
|
||||||
|
return await axios.get(`/playlist/${playlistId}`)
|
||||||
|
.then((response: AxiosResponse) => {
|
||||||
|
return response.data
|
||||||
|
}).catch((error: Error) => {
|
||||||
|
console.log("Error: " + error);
|
||||||
|
})
|
||||||
|
}
|
Loading…
Add table
Add a link
Reference in a new issue