This repository has been archived on 2024-02-08. You can view files and clone it, but cannot push or open issues or pull requests.
frontend/src/views/list/settings/delete.vue

37 lines
828 B
Vue

<template>
<modal
@close="$router.back()"
@submit="deleteList()"
>
<span slot="header">{{ $t('list.delete.header') }}</span>
<p slot="text">
{{ $t('list.delete.text1') }}<br/>
{{ $t('list.delete.text2') }}
</p>
</modal>
</template>
<script>
export default {
name: 'list-setting-delete',
created() {
const list = this.$store.getters['lists/getListById'](this.$route.params.listId)
this.setTitle(this.$t('list.delete.title', {list: list.title}))
},
methods: {
deleteList() {
const list = this.$store.getters['lists/getListById'](this.$route.params.listId)
this.$store.dispatch('lists/deleteList', list)
.then(() => {
this.success({message: this.$t('list.delete.success')})
this.$router.push({name: 'home'})
})
.catch(e => {
this.error(e)
})
},
},
}
</script>