1
0

feat: don't rethrow same error and handle errors globally

This commit is contained in:
Dominik Pschenitschni
2021-10-09 16:04:19 +02:00
parent 6f51921588
commit 3b940cb56c
71 changed files with 69 additions and 451 deletions

View File

@ -87,12 +87,9 @@ export default {
Cropper,
},
methods: {
avatarStatus() {
this.avatarService.get({})
.then(r => {
this.avatarProvider = r.avatarProvider
})
.catch(e => this.$message.error(e))
async avatarStatus() {
const { avatarProvider } = await this.avatarService.get({})
this.avatarProvider = avatarProvider
},
updateAvatarStatus() {
const avatarStatus = new AvatarModel({avatarProvider: this.avatarProvider})
@ -101,7 +98,6 @@ export default {
this.$message.success({message: this.$t('user.settings.avatar.statusUpdateSuccess')})
this.$store.commit('auth/reloadAvatar')
})
.catch(e => this.$message.error(e))
},
uploadAvatar() {
this.loading = true
@ -114,7 +110,6 @@ export default {
this.$message.success({message: this.$t('user.settings.avatar.setSuccess')})
this.$store.commit('auth/reloadAvatar')
})
.catch(e => this.$message.error(e))
.finally(() => {
this.loading = false
this.isCropAvatar = false

View File

@ -64,7 +64,6 @@ export default {
this.$message.success({message: this.$t('user.export.success')})
this.password = ''
})
.catch(e => this.$message.error(e))
},
},
}

View File

@ -113,7 +113,6 @@ export default {
this.$message.success({message: this.$t('user.deletion.requestSuccess')})
this.password = ''
})
.catch(e => this.$message.error(e))
},
cancelDeletion() {
if (this.password === '') {
@ -128,7 +127,6 @@ export default {
this.$store.dispatch('auth/refreshUserInfo')
this.password = ''
})
.catch(e => this.$message.error(e))
},
},
}