improve error handling logic

This commit is contained in:
taehoon 2019-04-27 09:36:10 -04:00
parent 12f8269f01
commit 2af088969a
3 changed files with 11 additions and 5 deletions

View file

@ -25,11 +25,14 @@ const ExtraButtons = {
pinStatus () {
this.refreshPopper()
this.$store.dispatch('pinStatus', this.status.id)
.then(() => this.$emit('onSuccess'))
.catch(err => this.$emit('onError', err.error.error))
},
unpinStatus () {
this.refreshPopper()
this.$store.dispatch('unpinStatus', this.status.id)
.then(() => this.$emit('onSuccess'))
.catch(err => this.$emit('onError', err.error.error))
},
refreshPopper () {
this.showPopper = false