Changeset View
Changeset View
Standalone View
Standalone View
src/resources/vue/User/Info.vue
Show First 20 Lines • Show All 213 Lines • ▼ Show 20 Lines | export default { | ||||
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 | ||||
axios.get('/api/v4/skus') | axios.get('/api/v4/users/' + this.user_id + '/skus?type=user') | ||||
.then(response => { | .then(response => { | ||||
// "merge" SKUs with user entitlement-SKUs | // "merge" SKUs with user entitlement-SKUs | ||||
this.skus = response.data | this.skus = response.data | ||||
.filter(sku => sku.type == 'user') | |||||
.map(sku => { | .map(sku => { | ||||
if (sku.id in this.user.skus) { | if (sku.id in this.user.skus) { | ||||
sku.enabled = true | sku.enabled = true | ||||
sku.value = this.user.skus[sku.id].count | sku.value = this.user.skus[sku.id].count | ||||
} else if (!sku.readonly) { | } else if (!sku.readonly) { | ||||
sku.enabled = false | sku.enabled = false | ||||
} | } | ||||
▲ Show 20 Lines • Show All 136 Lines • Show Last 20 Lines |