0
0
Fork 0

Move auth_redirect and API base URL to global variables via the mixin.

This commit is contained in:
Tyler-A 2020-08-09 00:15:57 -06:00
parent 572c8b1674
commit 0d3e0f8f5a
5 changed files with 7 additions and 29 deletions

View file

@ -3,7 +3,6 @@
<Control
:dev="dev_mode"
:preview="preview_mode"
:api_url="api_base"
:auth_redirect="auth_redirect"
:token="get_token()"
:data_exists="data.length !== 0"
@ -39,10 +38,6 @@ export default {
dev_mode: {
type: Boolean,
required: true,
},
auth_redirect: {
type: String,
required: true,
}
},
components: {
@ -54,7 +49,6 @@ export default {
config: {},
data: [],
error: ``,
api_base: `https://api.spotify.com/v1`,
};},
computed: {
items() {
@ -70,7 +64,7 @@ export default {
console.log("Handling the export");
},
get_data(config) {
let url = `${this.api_base}/me/top/${config.type.toLowerCase()}`;
let url = `${this.api_url}/me/top/${config.type.toLowerCase()}`;
let limit = config.limit || 10;