Handle parameters with mixin.

This commit is contained in:
FireMasterK 2021-07-04 21:07:49 +05:30
parent 3b0f1a7678
commit d76781847b
No known key found for this signature in database
GPG key ID: 49451E4482CC5BCD

View file

@ -34,11 +34,9 @@ export default {
}, },
methods: { methods: {
async fetchTrending(region) { async fetchTrending(region) {
let url = Constants.BASE_URL + "/trending"; return await this.fetchJson(Constants.BASE_URL + "/trending", {
if (region) { region: region || "US",
url += "?region=" + region; });
}
return await this.fetchJson(url);
}, },
}, },
components: { components: {