From ffec9d992aa5d1231eda09e3f653b7b32482d53c Mon Sep 17 00:00:00 2001 From: bopol Date: Sun, 4 Jul 2021 19:53:36 +0200 Subject: [PATCH] Support region for trending (#239) * Support region for trending * Handle parameters with mixin. Co-authored-by: FireMasterK <20838718+FireMasterK@users.noreply.github.com> --- src/components/TrendingPage.vue | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/components/TrendingPage.vue b/src/components/TrendingPage.vue index a32545d1..31c22504 100644 --- a/src/components/TrendingPage.vue +++ b/src/components/TrendingPage.vue @@ -28,11 +28,15 @@ export default { mounted() { document.title = "Trending - Piped"; - this.fetchTrending().then(videos => (this.videos = videos)); + let region = this.$route.query.region; + + this.fetchTrending(region).then(videos => (this.videos = videos)); }, methods: { - async fetchTrending() { - return await this.fetchJson(Constants.BASE_URL + "/trending"); + async fetchTrending(region) { + return await this.fetchJson(Constants.BASE_URL + "/trending", { + region: region || "US", + }); }, }, components: {