From 88bd16ae69163d0e0402c5507257887b429eac7a Mon Sep 17 00:00:00 2001 From: Tyler-A Date: Wed, 5 Aug 2020 22:43:19 -0600 Subject: [PATCH] Make data fetching use the actual value from control bar and store the config in the data object. --- src/components/MainView.vue | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/components/MainView.vue b/src/components/MainView.vue index fa367da..d708071 100644 --- a/src/components/MainView.vue +++ b/src/components/MainView.vue @@ -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}`