Changeset View
Changeset View
Standalone View
Standalone View
src/resources/vue/Admin/User.vue
Show First 20 Lines • Show All 444 Lines • ▼ Show 20 Lines | export default { | ||||
this.wallet = response.data | this.wallet = response.data | ||||
this.setMandateState() | this.setMandateState() | ||||
}) | }) | ||||
.catch(error => { | .catch(error => { | ||||
this.$root.removeLoader(financesTab) | this.$root.removeLoader(financesTab) | ||||
}) | }) | ||||
// Create subscriptions list | // Create subscriptions list | ||||
axios.get('/api/v4/skus') | axios.get('/api/v4/users/' + user_id + '/skus') | ||||
.then(response => { | .then(response => { | ||||
// "merge" SKUs with user entitlement-SKUs | // "merge" SKUs with user entitlement-SKUs | ||||
response.data.forEach(sku => { | response.data.forEach(sku => { | ||||
if (sku.id in this.user.skus) { | if (sku.id in this.user.skus) { | ||||
let count = this.user.skus[sku.id].count | let count = this.user.skus[sku.id].count | ||||
let item = { | let item = { | ||||
id: sku.id, | id: sku.id, | ||||
name: sku.name, | name: sku.name, | ||||
cost: sku.cost, | cost: sku.cost, | ||||
units: count - sku.units_free, | units: count - sku.units_free, | ||||
price: this.$root.priceLabel(sku.cost, count - sku.units_free, this.discount) | price: this.$root.priceLabel(sku.cost, count - sku.units_free, this.discount) | ||||
} | } | ||||
if (sku.range) { | if (sku.range) { | ||||
item.name += ' ' + count + ' ' + sku.range.unit | item.name += ' ' + count + ' ' + sku.range.unit | ||||
} | } | ||||
this.skus.push(item) | this.skus.push(item) | ||||
if (sku.title == '2fa') { | if (sku.handler == 'auth2f') { | ||||
this.has2FA = true | this.has2FA = true | ||||
this.sku2FA = sku.id | this.sku2FA = sku.id | ||||
} | } | ||||
} | } | ||||
}) | }) | ||||
}) | }) | ||||
// Fetch users | // Fetch users | ||||
▲ Show 20 Lines • Show All 175 Lines • Show Last 20 Lines |