Changeset View
Changeset View
Standalone View
Standalone View
src/resources/vue/User/ProfileDelete.vue
Show All 20 Lines | |||||
<script> | <script> | ||||
export default { | export default { | ||||
data() { | data() { | ||||
return { | return { | ||||
supportEmail: window.config['app.support_email'] | supportEmail: window.config['app.support_email'] | ||||
} | } | ||||
}, | }, | ||||
created() { | created() { | ||||
if (!this.$root.isController(this.$store.state.authInfo.wallet.id)) { | if (!this.$root.isController(this.$root.authInfo.wallet.id)) { | ||||
this.$root.errorPage(403) | this.$root.errorPage(403) | ||||
} | } | ||||
}, | }, | ||||
mounted() { | mounted() { | ||||
$('button.btn-secondary').focus() | $('button.btn-secondary').focus() | ||||
}, | }, | ||||
methods: { | methods: { | ||||
deleteProfile() { | deleteProfile() { | ||||
axios.delete('/api/v4/users/' + this.$store.state.authInfo.id) | axios.delete('/api/v4/users/' + this.$root.authInfo.id) | ||||
.then(response => { | .then(response => { | ||||
if (response.data.status == 'success') { | if (response.data.status == 'success') { | ||||
this.$root.logoutUser() | this.$root.logoutUser() | ||||
this.$toast.success(response.data.message) | this.$toast.success(response.data.message) | ||||
} | } | ||||
}) | }) | ||||
} | } | ||||
} | } | ||||
} | } | ||||
</script> | </script> |