diff --git a/admin/src/pages/CreationConfirm.vue b/admin/src/pages/CreationConfirm.vue index 712e4ece1..202133460 100644 --- a/admin/src/pages/CreationConfirm.vue +++ b/admin/src/pages/CreationConfirm.vue @@ -36,8 +36,7 @@ export default { }, }) .then((result) => { - this.pendingCreations = this.pendingCreations.filter((obj) => obj.id !== item.id) - this.$store.commit('openCreationsMinus', 1) + this.updatePendingCreations(item.id) this.$toasted.success(this.$t('creation_form.toasted_delete')) }) .catch((error) => { @@ -53,8 +52,7 @@ export default { }, }) .then((result) => { - this.pendingCreations = this.pendingCreations.filter((obj) => obj.id !== item.id) - this.$store.commit('openCreationsMinus', 1) + this.updatePendingCreations(item.id) this.$toasted.success(this.$t('creation_form.toasted_created')) }) .catch((error) => { @@ -76,6 +74,10 @@ export default { this.$toasted.error(error.message) }) }, + updatePendingCreations(id) { + this.pendingCreations = this.pendingCreations.filter((obj) => obj.id !== id) + this.$store.commit('openCreationsMinus', 1) + }, }, computed: { fields() {