Needs to have another logic to remove item from list if remove or if confirmed was successful.

This commit is contained in:
elweyn 2021-12-13 13:19:00 +01:00
parent 67a9f2d0e0
commit 51333155c9
2 changed files with 7 additions and 3 deletions

View File

@ -237,7 +237,7 @@ export default {
},
})
.then(() => {
this.$emit('remove-confirm-result', item, 'remove')
this.$emit('remove-confirm-result', item, 'confirmed')
})
.catch((error) => {
this.$toasted.error(error.message)

View File

@ -51,9 +51,9 @@ export default {
},
methods: {
removeConfirmResult(e, event) {
let index = 0
const findArr = this.confirmResult.find((arr) => arr.id === e.id)
if (event === 'remove') {
let index = 0
const findArr = this.confirmResult.find((arr) => arr.id === e.id)
this.$apollo
.mutate({
mutation: deletePendingCreation,
@ -70,6 +70,10 @@ export default {
.catch((error) => {
this.$toasted.error(error.message)
})
} else {
this.confirmResult.splice(index, 1)
this.$store.commit('openCreationsMinus', 1)
this.$toasted.success('Pending Creation has been deleted')
}
},
getPendingCreations() {