Handle icon & qrcode upload failure gracefully

This commit is contained in:
Bubka
2022-09-02 14:28:57 +02:00
parent fa8bd1def0
commit 61d177aecd
7 changed files with 55 additions and 36 deletions

View File

@@ -265,10 +265,12 @@
let imgdata = new FormData();
imgdata.append('icon', this.$refs.iconInput.files[0]);
const { data } = await this.form.upload('/api/v1/icons', imgdata)
this.tempIcon = data.filename;
this.form.upload('/api/v1/icons', imgdata, {returnError: true}).then(response => {
this.tempIcon = response.data.filename;
})
.catch(error => {
this.$notify({type: 'is-danger', text: this.$t(error.response.data.message) })
});
},
fetchLogo() {