mirror of
https://github.com/Bubka/2FAuth.git
synced 2025-05-30 06:49:11 +02:00
Delete account from index
This commit is contained in:
parent
20a2d40a85
commit
386e852ffc
@ -2,10 +2,13 @@
|
|||||||
<div>
|
<div>
|
||||||
<div class="container">
|
<div class="container">
|
||||||
<div class="buttons are-large is-centered">
|
<div class="buttons are-large is-centered">
|
||||||
<span v-for="account in accounts" class="button is-black twofaccount" @click.stop="getAccount(account.id)">
|
<span v-for="account in accounts" class="button is-black twofaccount" >
|
||||||
<img src="https://fakeimg.pl/64x64/">
|
<span @click.stop="getAccount(account.id)">
|
||||||
{{ account.name }}
|
<img src="https://fakeimg.pl/64x64/">
|
||||||
<span class="is-family-primary is-size-7 has-text-grey">{{ account.email }}</span>
|
{{ account.name }}
|
||||||
|
<span class="is-family-primary is-size-7 has-text-grey">{{ account.email }}</span>
|
||||||
|
</span>
|
||||||
|
<a v-on:click="deleteAccount(account.id)">Delete</a>
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -83,6 +86,17 @@
|
|||||||
this.ShowTwofaccountInModal = true;
|
this.ShowTwofaccountInModal = true;
|
||||||
|
|
||||||
})
|
})
|
||||||
|
},
|
||||||
|
|
||||||
|
deleteAccount: function (id) {
|
||||||
|
let token = localStorage.getItem('jwt')
|
||||||
|
|
||||||
|
axios.defaults.headers.common['Content-Type'] = 'application/json'
|
||||||
|
axios.defaults.headers.common['Authorization'] = 'Bearer ' + token
|
||||||
|
|
||||||
|
axios.delete('/api/twofaccounts/' + id).then(response => {
|
||||||
|
this.accounts.splice(this.accounts.findIndex(x => x.id === id), 1);
|
||||||
|
})
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
beforeRouteEnter (to, from, next) {
|
beforeRouteEnter (to, from, next) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user