fix: namespace archive success message

This commit is contained in:
kolaente 2022-01-26 14:41:41 +01:00
parent 78ad9becf3
commit 8b90b8f6a8
No known key found for this signature in database
GPG key ID: F40E70337AB24C9B
2 changed files with 4 additions and 2 deletions

View file

@ -335,6 +335,7 @@
"archiveText": "You won't be able to edit this namespace or create new lists until you un-archive it. This will also archive all lists in this namespace.",
"unarchiveText": "You will be able to create new lists or edit it.",
"success": "The namespace was successfully archived.",
"unarchiveSuccess": "The namespace was successfully un-archived.",
"description": "If a namespace is archived, you cannot create new lists or edit it."
},
"delete": {

View file

@ -37,12 +37,13 @@ export default {
methods: {
async archiveNamespace() {
try {
const isArchived = !this.namespace.isArchived
const namespace = await this.namespaceService.update({
...this.namespace,
isArchived: !this.namespace.isArchived,
isArchived,
})
this.$store.commit('namespaces/setNamespaceById', namespace)
this.$message.success({message: this.$t('namespace.archive.success')})
this.$message.success({message: this.$t(isArchived ? 'namespace.archive.success' : 'namespace.archive.unarchiveSuccess')})
} finally {
this.$router.back()
}