Skip to content

Commit

Permalink
Show Group Account quests #92
Browse files Browse the repository at this point in the history
  • Loading branch information
Zlimon committed Sep 11, 2021
1 parent c27d760 commit a3e4d9a
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 18 deletions.
36 changes: 24 additions & 12 deletions resources/js/components/account/Quests.vue
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,21 @@ export default {
return this.account.id === accountId;
},
fetchAccountQuests() {
axios
.get('/api/account/' + this.account.username + '/quests')
.then((response) => {
this.quests = response.data.data;
this.display = response.data.display !== 0;
this.errored = false
})
.catch(error => {
console.log(error)
this.errored = true
})
.finally(() => this.loading = false);
},
updateDisplayQuests() {
axios
.post('/api/account/' + this.account.username + '/quests', {
Expand All @@ -72,6 +87,13 @@ export default {
}
},
watch: {
account(account) {
this.account = account;
this.fetchAccountQuests();
}
},
data() {
return {
loading: true,
Expand All @@ -89,20 +111,10 @@ export default {
this.user = response.data;
})
.catch(error => {
console.log(error)
});
axios
.get('/api/account/' + this.account.username + '/quests')
.then((response) => {
this.quests = response.data.data;
this.display = response.data.display !== 0;
})
.catch(error => {
console.log(error)
this.errored = true
})
.finally(() => this.loading = false);
this.fetchAccountQuests();
},
created() {
Expand Down
16 changes: 10 additions & 6 deletions resources/js/pages/group/Show.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,9 @@

<div class="row">
<div class="col-md-5">
<div v-if="account">
<div v-if="account !== null">
<h1 class="text-center">{{ account.username }}</h1>

<h3 class="text-center header-chatbox-sword">Equipment</h3>

<equipment :account="account"></equipment>

<div class="mt-4">
<div v-if="skills">
<div class="row">
Expand Down Expand Up @@ -45,6 +41,14 @@
<component v-bind:is="component" :account="account"/>
</keep-alive>
</div>

<h3 class="text-center header-chatbox-sword">Equipment</h3>

<equipment :account="account"></equipment>

<h3 class="text-center header-chatbox-sword">Quests</h3>

<quests :account="account"></quests>
</div>
</div>

Expand Down Expand Up @@ -91,7 +95,7 @@ export default {
data() {
return {
account: {},
account: null,
skills: true,
component: AccountSkillHiscore,
}
Expand Down

0 comments on commit a3e4d9a

Please sign in to comment.