mirror of
				https://github.com/TeamPiped/Piped.git
				synced 2024-08-14 23:57:27 +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
							
								
									badaa7ce5a
								
							
						
					
					
						commit
						fc9fd65a8d
					
				
					 1 changed files with 7 additions and 3 deletions
				
			
		| 
						 | 
				
			
			@ -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: {
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue