diff options
| author | taehoon <th.dev91@gmail.com> | 2019-04-24 16:19:27 -0400 |
|---|---|---|
| committer | taehoon <th.dev91@gmail.com> | 2019-05-15 12:04:25 -0400 |
| commit | 1229622fedf4401f2ce2e5aa6741de3a8b1291a3 (patch) | |
| tree | 34e77fdf0db2148f4f71c860f4ffeab1153ac51d /src/components/extra_buttons/extra_buttons.js | |
| parent | ce1d19136de322637695891b11117946664eacd6 (diff) | |
refactor error handling of pinStatus
Diffstat (limited to 'src/components/extra_buttons/extra_buttons.js')
| -rw-r--r-- | src/components/extra_buttons/extra_buttons.js | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/src/components/extra_buttons/extra_buttons.js b/src/components/extra_buttons/extra_buttons.js index 55a4caad..51892d0d 100644 --- a/src/components/extra_buttons/extra_buttons.js +++ b/src/components/extra_buttons/extra_buttons.js @@ -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() |
