mirror of
https://github.com/ragestudio/comty.git
synced 2025-06-10 19:14:16 +00:00
added getPlaylistsFeed
method
This commit is contained in:
parent
43f016358e
commit
65f071c628
@ -1,10 +1,10 @@
|
|||||||
export default class Post {
|
export default class FeedModel {
|
||||||
static get bridge() {
|
static get bridge() {
|
||||||
return window.app?.api.withEndpoints("main")
|
return window.app?.api.withEndpoints("main")
|
||||||
}
|
}
|
||||||
|
|
||||||
static async getPostsFeed({ trim, limit }) {
|
static async getPostsFeed({ trim, limit }) {
|
||||||
if (!Post.bridge) {
|
if (!FeedModel.bridge) {
|
||||||
throw new Error("Bridge is not available")
|
throw new Error("Bridge is not available")
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -19,4 +19,21 @@ export default class Post {
|
|||||||
|
|
||||||
return data
|
return data
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static async getPlaylistsFeed({ trim, limit }) {
|
||||||
|
if (!FeedModel.bridge) {
|
||||||
|
throw new Error("Bridge is not available")
|
||||||
|
}
|
||||||
|
|
||||||
|
const { data } = await app.api.customRequest("main", {
|
||||||
|
method: "GET",
|
||||||
|
url: `/feed/playlists`,
|
||||||
|
params: {
|
||||||
|
trim: trim ?? 0,
|
||||||
|
limit: limit ?? window.app.settings.get("feed_max_fetch"),
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
return data
|
||||||
|
}
|
||||||
}
|
}
|
Loading…
x
Reference in New Issue
Block a user