mirror of
https://github.com/TeamPiped/Piped.git
synced 2025-01-10 23:07:00 +00:00
Support region for trending (#239)
* Support region for trending * Handle parameters with mixin. Co-authored-by: FireMasterK <20838718+FireMasterK@users.noreply.github.com>
This commit is contained in:
parent
192c2b82bb
commit
ffec9d992a
@ -28,11 +28,15 @@ export default {
|
|||||||
mounted() {
|
mounted() {
|
||||||
document.title = "Trending - Piped";
|
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: {
|
methods: {
|
||||||
async fetchTrending() {
|
async fetchTrending(region) {
|
||||||
return await this.fetchJson(Constants.BASE_URL + "/trending");
|
return await this.fetchJson(Constants.BASE_URL + "/trending", {
|
||||||
|
region: region || "US",
|
||||||
|
});
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
components: {
|
components: {
|
||||||
|
Loading…
Reference in New Issue
Block a user