1
0

Refactor success and error messages

This commit is contained in:
kolaente
2021-06-22 22:07:57 +02:00
parent ab4edc17de
commit cdc805c8da
55 changed files with 219 additions and 256 deletions

View File

@ -93,16 +93,16 @@ export default {
.then(r => {
this.avatarProvider = r.avatarProvider
})
.catch(e => this.error(e, this))
.catch(e => this.error(e))
},
updateAvatarStatus() {
const avatarStatus = new AvatarModel({avatarProvider: this.avatarProvider})
this.avatarService.update(avatarStatus)
.then(() => {
this.success({message: 'Avatar status was updated successfully!'}, this)
this.success({message: 'Avatar status was updated successfully!'})
this.$store.commit('auth/reloadAvatar')
})
.catch(e => this.error(e, this))
.catch(e => this.error(e))
},
uploadAvatar() {
this.loading = true
@ -112,10 +112,10 @@ export default {
canvas.toBlob(blob => {
this.avatarService.create(blob)
.then(() => {
this.success({message: 'The avatar has been set successfully!'}, this)
this.success({message: 'The avatar has been set successfully!'})
this.$store.commit('auth/reloadAvatar')
})
.catch(e => this.error(e, this))
.catch(e => this.error(e))
.finally(() => {
this.loading = false
this.isCropAvatar = false