forked from KKBOX/OpenAPI-JavaScript
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathFeaturedPlaylistFetcher.js
More file actions
32 lines (30 loc) · 922 Bytes
/
Copy pathFeaturedPlaylistFetcher.js
File metadata and controls
32 lines (30 loc) · 922 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
import { FEATURED_PLAYLISTS as ENDPOINT } from '../Endpoint';
import Fetcher from './Fetcher';
/**
* List all featured playlists.
* @see https://docs-en.kkbox.codes/v1.1/reference#featured-playlists
*/
export default class FeaturedPlaylistFetcher extends Fetcher {
/**
* @ignore
*/
constructor(http, territory = 'TW') {
super(http, territory);
}
/**
* Fetch all featured playlists. Result will be paged.
*
* @param {number} [limit] - The size for one page.
* @param {number} [offset] - The offset index for first element.
* @return {Promise}
* @example api.featuredPlaylistFetcher.fetchAllFeaturedPlaylists();
* @see https://docs-en.kkbox.codes/v1.1/reference#featuredplaylists
*/
fetchAllFeaturedPlaylists(limit = undefined, offset = undefined) {
return this.http.get(ENDPOINT, {
limit: limit,
offset: offset,
territory: this.territory
});
}
}