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 All 33 Lines | export default { | ||||
}) | }) | ||||
this.user.skus = skus | this.user.skus = skus | ||||
} else { | } else { | ||||
this.user.package = this.package_id | this.user.package = this.package_id | ||||
} | } | ||||
axios[method](location, this.user) | axios[method](location, this.user) | ||||
.then(response => { | .then(response => { | ||||
if (response.data.statusInfo) { | |||||
this.$store.state.authInfo.statusInfo = response.data.statusInfo | |||||
} | |||||
this.$toast.success(response.data.message) | this.$toast.success(response.data.message) | ||||
this.$router.push({ name: 'users' }) | this.$router.push({ name: 'users' }) | ||||
}) | }) | ||||
}, | }, | ||||
onInputSku(e) { | onInputSku(e) { | ||||
let input = e.target | let input = e.target | ||||
let sku = this.findSku(input.value) | let sku = this.findSku(input.value) | ||||
let required = [] | let required = [] | ||||
▲ Show 20 Lines • Show All 87 Lines • Show Last 20 Lines |