diff --git a/src/store/modules/namespaces.js b/src/store/modules/namespaces.js index ae47a95f..8adab74c 100644 --- a/src/store/modules/namespaces.js +++ b/src/store/modules/namespaces.js @@ -23,8 +23,6 @@ export default { return } - // FIXME: direct manipulation of the prop - // might not be a problem since this is happening in the mutation if (!namespace.lists || namespace.lists.length === 0) { namespace.lists = state.namespaces[namespaceIndex].lists } diff --git a/src/views/namespaces/settings/archive.vue b/src/views/namespaces/settings/archive.vue index 9eb1305b..e08457e9 100644 --- a/src/views/namespaces/settings/archive.vue +++ b/src/views/namespaces/settings/archive.vue @@ -4,9 +4,11 @@ @submit="archiveNamespace()" > - + @@ -27,17 +29,18 @@ export default { created() { this.namespace = this.$store.getters['namespaces/getNamespaceById'](this.$route.params.id) this.title = this.namespace.isArchived ? - this.$t('namespace.archive.titleUnarchive', { namespace: this.namespace.title }) : - this.$t('namespace.archive.titleArchive', { namespace: this.namespace.title }) + this.$t('namespace.archive.titleUnarchive', {namespace: this.namespace.title}) : + this.$t('namespace.archive.titleArchive', {namespace: this.namespace.title}) this.setTitle(this.title) }, methods: { async archiveNamespace() { - this.namespace.isArchived = !this.namespace.isArchived - try { - const namespace = await this.namespaceService.update(this.namespace) + const namespace = await this.namespaceService.update({ + ...this.namespace, + isArchived: !this.namespace.isArchived, + }) this.$store.commit('namespaces/setNamespaceById', namespace) this.$message.success({message: this.$t('namespace.archive.success')}) } finally {