mirror of
https://github.com/ragestudio/comty.git
synced 2025-06-10 02:54:15 +00:00
added PlaylistModel
This commit is contained in:
parent
50072b2320
commit
83c6f26439
18
packages/app/src/models/playlists/index.js
Normal file
18
packages/app/src/models/playlists/index.js
Normal 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
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user