added getPlaylistsFeed method

This commit is contained in:
SrGooglo 2022-12-13 11:55:30 +00:00
parent 43f016358e
commit 65f071c628

View File

@ -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
}
} }