Changeset View
Changeset View
Standalone View
Standalone View
src/resources/vue/Reseller/Signups.vue
- This file was added.
<template> | |||||
<div class="container"> | |||||
<div class="card" id="signups-list"> | |||||
<div class="card-body"> | |||||
<div class="card-title">Signups</div> | |||||
<div class="card-text"> | |||||
<table class="table table-sm table-hover"> | |||||
<thead class="thead-light"> | |||||
<tr> | |||||
<th scope="col">Email</th> | |||||
<th scope="col">External Email</th> | |||||
<th scope="col">Name</th> | |||||
<th scope="col"></th> | |||||
</tr> | |||||
</thead> | |||||
<tbody> | |||||
<tr v-for="user in users" :id="'user' + user.id" :key="user.id"> | |||||
<td><svg-icon icon="user"></svg-icon> {{ user.email }}</td> | |||||
<td>{{ user.external_email }}</td> | |||||
<td>{{ user.name }}</td> | |||||
<td class="buttons"> | |||||
<button class="btn btn-sm btn-success" @click="approveUser(user.id)">Approve</button> | |||||
<button class="btn btn-sm btn-danger" @click="dismissUser(user.id)">Dismiss</button> | |||||
</td> | |||||
</tr> | |||||
</tbody> | |||||
<tfoot class="table-fake-body"> | |||||
<tr> | |||||
<td colspan="4">There are no new signups for approval.</td> | |||||
</tr> | |||||
</tfoot> | |||||
</table> | |||||
</div> | |||||
</div> | |||||
</div> | |||||
</div> | |||||
</template> | |||||
<script> | |||||
export default { | |||||
data() { | |||||
return { | |||||
users: [] | |||||
} | |||||
}, | |||||
created() { | |||||
this.$root.startLoading() | |||||
axios.get('/api/v4/users/drafts') | |||||
.then(response => { | |||||
this.$root.stopLoading() | |||||
this.users = response.data.list | |||||
}) | |||||
.catch(this.$root.errorHandler) | |||||
}, | |||||
methods: { | |||||
approveUser(id) { | |||||
axios.post('/api/v4/users/' + id + '/approve') | |||||
.then(response => { | |||||
if (response.data.status == 'success') { | |||||
this.$toast.success(response.data.message) | |||||
$('#user' + id).remove() | |||||
} | |||||
}) | |||||
}, | |||||
dismissUser(id) { | |||||
} | |||||
} | |||||
} | |||||
</script> |