refactor error handling of pinStatus

This commit is contained in:
taehoon 2019-04-24 16:19:27 -04:00
parent ce1d19136d
commit 1229622fed
3 changed files with 8 additions and 17 deletions

View file

@ -24,11 +24,8 @@ const ExtraButtons = {
},
pinStatus () {
this.refreshPopper()
this.$store.dispatch('pinStatus', this.status.id).then((status) => {
if (status.error) {
this.$emit('onError', status.error)
}
})
this.$store.dispatch('pinStatus', this.status.id)
.catch(err => this.$emit('onError', err.error.error))
},
unpinStatus () {
this.refreshPopper()