diff --git a/src/store/modules/namespaces.js b/src/store/modules/namespaces.js index 1345805f..529bd952 100644 --- a/src/store/modules/namespaces.js +++ b/src/store/modules/namespaces.js @@ -41,6 +41,14 @@ export default { addNamespace(state, namespace) { state.namespaces.push(namespace) }, + removeNamespaceById(state, namespaceId) { + for (const n in state.namespaces) { + if (state.namespaces[n].id === namespaceId) { + state.namespaces.splice(n, 1) + return + } + } + }, addListToNamespace(state, list) { for (const n in state.namespaces) { if (state.namespaces[n].id === list.namespaceId) { diff --git a/src/views/namespaces/EditNamespace.vue b/src/views/namespaces/EditNamespace.vue index 2bb7a0fb..8f7c9d9e 100644 --- a/src/views/namespaces/EditNamespace.vue +++ b/src/views/namespaces/EditNamespace.vue @@ -95,7 +95,7 @@ + @submit="deleteNamespace()"> Delete the namespace

Are you sure you want to delete this namespace and all of its contents?
This includes lists & tasks and CANNOT BE UNDONE!

@@ -192,6 +192,7 @@ export default { deleteNamespace() { this.namespaceService.delete(this.namespace) .then(() => { + this.$store.commit('namespaces/removeNamespaceById', this.namespace.id) this.success({message: 'The namespace was successfully deleted.'}, this) router.push({name: 'home'}) })