0
0
Fork 0

Make data fetching use the actual value from control bar and store the config in the data object.

This commit is contained in:
Tyler-A 2020-08-05 22:43:19 -06:00
parent 948efcc54b
commit 88bd16ae69

View file

@ -70,7 +70,7 @@ export default {
get_data(config) {
let url = `${this.api_base}/me/top/${config.type.toLowerCase()}`;
let limit = parseInt(config.count) || 10;
let limit = config.limit || 10;
url += `?limit=${limit}&time_range=${config.duration}`;
@ -79,6 +79,7 @@ export default {
{ headers: { Authorization: `Bearer ${this.get_token()}` } }
).then((response) => {
this.error = ``;
this.config = config;
this.data = response.data.items;
}).catch((err) => {
this.error = `${err.name}: ${err.message}`