new exception

Signed-off-by: Jakob Röhrl <jakob.roehrl@web.de>
This commit is contained in:
Jakob Röhrl
2020-03-11 12:08:03 +01:00
committed by Julius Härtl
parent 7750621917
commit 1e3ff41cb2
4 changed files with 48 additions and 13 deletions
@@ -80,14 +80,15 @@ export default {
clickAddNewAttachmment() {
this.$refs.localAttachments.click()
},
onLocalAttachmentSelected(e) {
async onLocalAttachmentSelected(e) {
const bodyFormData = new FormData()
bodyFormData.append('cardId', this.card.id)
bodyFormData.append('type', 'deck_file')
bodyFormData.append('file', e.target.files[0])
try {
this.$store.dispatch('createAttachment', { cardId: this.card.id, formData: bodyFormData })
await this.$store.dispatch('createAttachment', { cardId: this.card.id, formData: bodyFormData })
} catch (e) {
console.log("doppelt")
console.log(e)
}
},