Files
habitica/website/client/components/settings/resetModal.vue
Keith Holliday 88f872ed50 New client settings (#8886)
* Added initial settings page

* Initial cleanup and translations

* Ported api settings

* Ported promocode settings

* POrted notifications code

* Fixed styles and translatins for site page

* Ported over rest of settings functions

* Ported payments over

* Initial lint clean up

* Added amazon modal

* Added stripe

* Added site settings
2017-07-20 12:01:00 -06:00

37 lines
932 B
Vue

<template lang="pug">
b-modal#reset(:title="$t('resetAccount')", :hide-footer='true' size='md')
p {{ $t('resetText1') }}
p {{ $t('resetText2') }}
.modal-footer
button.btn.btn-danger(@click='close()') {{ $t('neverMind') }}
button.btn.btn-primary(@click='reset()') {{ $t('resetDo') }}
</template>
<script>
import axios from 'axios';
import { mapState } from 'client/libs/store';
import bModal from 'bootstrap-vue/lib/components/modal';
export default {
components: {
bModal,
},
computed: {
...mapState({user: 'user.data'}),
},
methods: {
close () {
this.$root.$emit('hide::modal', 'reset');
},
async reset () {
let response = await axios.post('/api/v3/user/reset');
// @TODO: Not sure if this is correct
this.$store.user = response.data.data.user;
this.$router.push('/');
this.$root.$emit('hide::modal', 'reset');
},
},
};
</script>