mirror of
https://github.com/ragestudio/comty.git
synced 2025-06-10 02:54:15 +00:00
added getPlaylistsFeed
method
This commit is contained in:
parent
8eabaa9654
commit
3b7b6fe4fe
@ -1,10 +1,10 @@
|
||||
export default class Post {
|
||||
export default class FeedModel {
|
||||
static get bridge() {
|
||||
return window.app?.api.withEndpoints("main")
|
||||
}
|
||||
|
||||
static async getPostsFeed({ trim, limit }) {
|
||||
if (!Post.bridge) {
|
||||
if (!FeedModel.bridge) {
|
||||
throw new Error("Bridge is not available")
|
||||
}
|
||||
|
||||
@ -19,4 +19,21 @@ export default class Post {
|
||||
|
||||
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