added PlaylistModel

This commit is contained in:
SrGooglo 2022-12-13 12:01:13 +00:00
parent 50072b2320
commit 83c6f26439

View File

@ -0,0 +1,18 @@
export default class PlaylistsModel {
static get bridge() {
return window.app?.api.withEndpoints("main")
}
static async getPlaylist(id) {
if (!PlaylistsModel.bridge) {
throw new Error("Bridge is not available")
}
const { data } = await app.api.customRequest("main", {
method: "GET",
url: `/playlist/${id}`,
})
return data
}
}