forked from KKBOX/OpenAPI-JavaScript
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathChartFetcher.js
More file actions
28 lines (26 loc) · 706 Bytes
/
Copy pathChartFetcher.js
File metadata and controls
28 lines (26 loc) · 706 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
import {CHARTS as ENDPOINT} from '../Endpoint'
import Fetcher from './Fetcher'
/**
* The fetcher that can fetch chart playlists.
* @see https://kkbox.gelato.io/docs/versions/1.1/resources/charts
*/
export default class ChartFetcher extends Fetcher {
/**
* @ignore
*/
constructor(http, territory = 'TW') {
super(http, territory = 'TW')
}
/**
* Fetch chart playlists.
*
* @return {Promise}
* @example api.chartFetcher.fetchCharts()
* @see https://kkbox.gelato.io/docs/versions/1.1/resources/charts/endpoints/get-charts
*/
fetchCharts() {
return this.http.get(ENDPOINT, {
territory: this.territory
})
}
}