Files
habitica/website/client/components/settings/deleteModal.vue
Keith Holliday 0b076311df New client misc with some more misc (#8929)
* Added markdown

* Added styles and option for debug menu

* Added sm icons

* Began styling autocomplete

* Added autocomplete styles

* Added more challenge categories

* Updated challenge participants modal

* Fixed challenge list updating without reload

* Added close and delete challenge

* Fixed form placeholder, adjusted desc style and fixed create button style

* Fixed faq collapsing and style

* Fixed repeating ending

* Fixed delete account

* Fixed party fetch issue

* Fixed scope issue

* Added member count filters

* Fixed create button style

* Fixed badge color display

* Updated tavern styles

* Fixed some party styles

* Updated login styles

* Fixed login redirect

* Fixed initial login process

* Added done local
2017-08-07 14:26:17 -06:00

55 lines
1.3 KiB
Vue

<template lang="pug">
b-modal#delete(:title="$t('deleteAccount')", :hide-footer='true' size='md')
strong {{ $t('deleteLocalAccountText') }}
br
.row
.col-6
input.form-control(type='password', v-model='password')
br
.row
#feedback.col-12.form-group
label(for='feedbackTextArea') {{ $t('feedback') }}
textarea#feedbackTextArea.form-control(v-model='feedback')
.modal-footer
button.btn.btn-danger(@click='close()') {{ $t('neverMind') }}
button.btn.btn-primary(@click='deleteAccount()', :disabled='!password') {{ $t('deleteDo') }}
</template>
<script>
import axios from 'axios';
import { mapState } from 'client/libs/store';
import bModal from 'bootstrap-vue/lib/components/modal';
export default {
components: {
bModal,
},
data () {
return {
password: '',
feedback: '',
};
},
computed: {
...mapState({user: 'user.data'}),
},
methods: {
close () {
this.$root.$emit('hide::modal', 'reset');
},
async deleteAccount () {
await axios.delete('/api/v3/user', {
data: {
password: this.password,
feedback: this.feedback,
},
});
localStorage.clear();
this.$router.push('/home');
this.$root.$emit('hide::modal', 'reset');
},
},
};
</script>