fix: vuex mutation error in edit list (#813)

Co-authored-by: Dominik Pschenitschni <mail@celement.de>
Reviewed-on: https://kolaente.dev/vikunja/frontend/pulls/813
Reviewed-by: konrad <k@knt.li>
Co-authored-by: dpschen <dpschen@noreply.kolaente.de>
Co-committed-by: dpschen <dpschen@noreply.kolaente.de>
This commit is contained in:
dpschen 2021-10-02 18:51:54 +00:00 committed by konrad
parent d13f3b9b19
commit 3f9917dfab

View file

@ -71,7 +71,6 @@ import ListService from '@/services/list'
import ColorPicker from '@/components/input/colorPicker.vue' import ColorPicker from '@/components/input/colorPicker.vue'
import LoadingComponent from '@/components/misc/loading.vue' import LoadingComponent from '@/components/misc/loading.vue'
import ErrorComponent from '@/components/misc/error.vue' import ErrorComponent from '@/components/misc/error.vue'
import ListDuplicateService from '@/services/listDuplicateService'
import {CURRENT_LIST} from '@/store/mutation-types' import {CURRENT_LIST} from '@/store/mutation-types'
import CreateEdit from '@/components/misc/create-edit.vue' import CreateEdit from '@/components/misc/create-edit.vue'
@ -81,7 +80,6 @@ export default {
return { return {
list: ListModel, list: ListModel,
listService: new ListService(), listService: new ListService(),
listDuplicateService: new ListDuplicateService(),
} }
}, },
components: { components: {
@ -106,9 +104,7 @@ export default {
this.listService.get(list) this.listService.get(list)
.then(r => { .then(r => {
this.$set(this, 'list', r) this.list = { ...r }
this.$store.commit(CURRENT_LIST, r)
this.setTitle(this.$t('list.edit.title', {list: this.list.title}))
}) })
.catch(e => { .catch(e => {
this.$message.error(e) this.$message.error(e)
@ -117,6 +113,8 @@ export default {
save() { save() {
this.$store.dispatch('lists/updateList', this.list) this.$store.dispatch('lists/updateList', this.list)
.then(() => { .then(() => {
this.$store.commit(CURRENT_LIST, this.list)
this.setTitle(this.$t('list.edit.title', {list: this.list.title}))
this.$message.success({message: this.$t('list.edit.success')}) this.$message.success({message: this.$t('list.edit.success')})
this.$router.back() this.$router.back()
}) })