Got rid of some smelly code and weird decisions I definitely wasn't responsible for in the first place.
Also updated API call
This commit is contained in:
@@ -6,39 +6,20 @@ export default {
|
||||
return {
|
||||
count: 0,
|
||||
items: [],
|
||||
user: '',
|
||||
user: {},
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.user = this.$route.params.name;
|
||||
let uid = this.$route.params.name;
|
||||
console.log(uid)
|
||||
|
||||
fetch(`http://iceberg-gaming.com:1323/api/v1/member/${uid}`).then(res => {
|
||||
res.json().then(user => {
|
||||
this.user = user;
|
||||
console.log(this.user)
|
||||
})
|
||||
})
|
||||
},
|
||||
computed: {
|
||||
headerInfo() {
|
||||
console.log(this.items)
|
||||
return this.items[0];
|
||||
},
|
||||
memberName() {
|
||||
try {
|
||||
return this.items[0].member_name;
|
||||
} catch (E) {
|
||||
console.log("too slow")
|
||||
}
|
||||
},
|
||||
memberRank() {
|
||||
try {
|
||||
return this.items[0].rank;
|
||||
} catch (E) {
|
||||
console.log("too slow")
|
||||
}
|
||||
},
|
||||
memberStatus() {
|
||||
try {
|
||||
return this.items[0].status;
|
||||
} catch (E) {
|
||||
console.log("too slow")
|
||||
}
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -49,9 +30,9 @@ export default {
|
||||
<img id="rangerTab" src="../icons/misc/test.png" class="xl:w-32 w-28" />
|
||||
</div>
|
||||
<div id="mainInfo">
|
||||
<h1>{{ memberName }}</h1>
|
||||
<h2>{{ memberRank }}</h2>
|
||||
<h2>{{ memberStatus }}</h2>
|
||||
<h1>{{ user.name }}</h1>
|
||||
<h2>{{ user.rank }}</h2>
|
||||
<h2>{{ user.company }}</h2>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
Reference in New Issue
Block a user