ad function deleteLink and bvModal confirm

This commit is contained in:
ogerly 2022-03-15 17:15:47 +01:00
parent 9d5cbf18b5
commit 81df36a3fb

View File

@ -18,7 +18,7 @@
<b-col cols="2">{{ $moment(item.validUntil).fromNow() }}</b-col> <b-col cols="2">{{ $moment(item.validUntil).fromNow() }}</b-col>
<b-col cols="2"> <b-col cols="2">
<b-button size="sm" variant="primary" @click="copy">kopieren</b-button> <b-button size="sm" variant="primary" @click="copy">kopieren</b-button>
<b-button size="sm" variant="danger" @click="deleteTransactionLink(item.id)">löschen</b-button> <b-button size="sm" variant="danger" @click="deleteLink(item.id)">löschen</b-button>
</b-col> </b-col>
</b-row> </b-row>
</div> </div>
@ -41,7 +41,8 @@ export default {
}, },
}) })
.then((result) => { .then((result) => {
console.log(result.data) this.toastSuccess('Link gelöscht')
this.$emit('update-list-transaction-links')
}) })
.catch((err) => { .catch((err) => {
this.toastError(err.message) this.toastError(err.message)
@ -58,6 +59,16 @@ export default {
this.toastError(this.$t('gdd_per_link.not-copied')) this.toastError(this.$t('gdd_per_link.not-copied'))
}) })
}, },
deleteLink(id) {
this.$bvModal
.msgBoxConfirm('Den Link löschen?')
.then(() => {
this.deleteTransactionLink(id)
})
.catch((err) => {
console.log(err)
})
},
}, },
} }
</script> </script>