Changeset View
Changeset View
Standalone View
Standalone View
src/resources/vue/Admin/User.vue
Show First 20 Lines • Show All 68 Lines • ▼ Show 20 Lines | <div class="container"> | ||||
</div> | </div> | ||||
</div> | </div> | ||||
<div class="form-group row"> | <div class="form-group row"> | ||||
<label for="country" class="col-sm-4 col-form-label">Country</label> | <label for="country" class="col-sm-4 col-form-label">Country</label> | ||||
<div class="col-sm-8"> | <div class="col-sm-8"> | ||||
<span class="form-control-plaintext" id="country">{{ user.country }}</span> | <span class="form-control-plaintext" id="country">{{ user.country }}</span> | ||||
</div> | </div> | ||||
</div> | </div> | ||||
<button v-if="!user.isSuspended" id="button-suspend" class="btn btn-warning" type="button" @click="suspendUser">Suspend</button> | |||||
<button v-if="user.isSuspended" id="button-unsuspend" class="btn btn-warning" type="button" @click="unsuspendUser">Unsuspend</button> | |||||
</form> | </form> | ||||
</div> | </div> | ||||
</div> | </div> | ||||
</div> | </div> | ||||
<ul class="nav nav-tabs mt-3" role="tablist"> | <ul class="nav nav-tabs mt-3" role="tablist"> | ||||
<li class="nav-item"> | <li class="nav-item"> | ||||
<a class="nav-link active" id="tab-finances" href="#user-finances" role="tab" aria-controls="user-finances" aria-selected="true"> | <a class="nav-link active" id="tab-finances" href="#user-finances" role="tab" aria-controls="user-finances" aria-selected="true"> | ||||
Finances | Finances | ||||
▲ Show 20 Lines • Show All 380 Lines • ▼ Show 20 Lines | export default { | ||||
.then(response => { | .then(response => { | ||||
if (response.data.status == 'success') { | if (response.data.status == 'success') { | ||||
$('#email-dialog').modal('hide') | $('#email-dialog').modal('hide') | ||||
this.$toast.success(response.data.message) | this.$toast.success(response.data.message) | ||||
this.user.external_email = this.external_email | this.user.external_email = this.external_email | ||||
this.external_email = null // required because of Vue | this.external_email = null // required because of Vue | ||||
} | } | ||||
}) | }) | ||||
}, | |||||
suspendUser() { | |||||
axios.post('/api/v4/users/' + this.user.id + '/suspend', {}) | |||||
.then(response => { | |||||
if (response.data.status == 'success') { | |||||
this.$toast.success(response.data.message) | |||||
this.user = Object.assign({}, this.user, { isSuspended: true }) | |||||
} | |||||
}) | |||||
}, | |||||
unsuspendUser() { | |||||
axios.post('/api/v4/users/' + this.user.id + '/unsuspend', {}) | |||||
.then(response => { | |||||
if (response.data.status == 'success') { | |||||
this.$toast.success(response.data.message) | |||||
this.user = Object.assign({}, this.user, { isSuspended: false }) | |||||
} | |||||
}) | |||||
} | } | ||||
} | } | ||||
} | } | ||||
</script> | </script> |