This repository has been archived on 2025-10-28. You can view files and clone it, but you cannot make any changes to it's state, such as pushing and creating new issues, pull requests or comments.
vikunja-frontend/src/views/list/settings/delete.vue

36 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>