Changeset View
Changeset View
Standalone View
Standalone View
src/resources/vue/User/Info.vue
Show First 20 Lines • Show All 187 Lines • ▼ Show 20 Lines | export default { | ||||
wallet = this.$store.state.authInfo.wallets[0] | wallet = this.$store.state.authInfo.wallets[0] | ||||
} | } | ||||
if (wallet && wallet.discount) { | if (wallet && wallet.discount) { | ||||
this.discount = wallet.discount | this.discount = wallet.discount | ||||
this.discount_description = wallet.discount_description | this.discount_description = wallet.discount_description | ||||
} | } | ||||
this.$root.startLoading() | |||||
if (this.user_id === 'new') { | if (this.user_id === 'new') { | ||||
// do nothing (for now) | // do nothing (for now) | ||||
axios.get('/api/v4/packages') | axios.get('/api/v4/packages') | ||||
.then(response => { | .then(response => { | ||||
this.$root.stopLoading() | |||||
this.packages = response.data.filter(pkg => !pkg.isDomain) | this.packages = response.data.filter(pkg => !pkg.isDomain) | ||||
this.package_id = this.packages[0].id | this.package_id = this.packages[0].id | ||||
}) | }) | ||||
.catch(this.$root.errorHandler) | .catch(this.$root.errorHandler) | ||||
} | } | ||||
else { | else { | ||||
axios.get('/api/v4/users/' + this.user_id) | axios.get('/api/v4/users/' + this.user_id) | ||||
.then(response => { | .then(response => { | ||||
this.$root.stopLoading() | |||||
this.user = response.data | this.user = response.data | ||||
this.user.first_name = response.data.settings.first_name | this.user.first_name = response.data.settings.first_name | ||||
this.user.last_name = response.data.settings.last_name | this.user.last_name = response.data.settings.last_name | ||||
this.user.organization = response.data.settings.organization | this.user.organization = response.data.settings.organization | ||||
this.discount = this.user.wallet.discount | this.discount = this.user.wallet.discount | ||||
this.discount_description = this.user.wallet.discount_description | this.discount_description = this.user.wallet.discount_description | ||||
this.status = response.data.statusInfo | this.status = response.data.statusInfo | ||||
▲ Show 20 Lines • Show All 155 Lines • Show Last 20 Lines |