refactor error handling of pinStatus
This commit is contained in:
parent
ce1d19136d
commit
1229622fed
3 changed files with 8 additions and 17 deletions
|
@ -546,12 +546,8 @@ const statuses = {
|
|||
.then(statuses => dispatch('addNewStatuses', { statuses, timeline: 'user', userId }))
|
||||
},
|
||||
pinStatus ({ rootState, commit }, statusId) {
|
||||
return rootState.api.backendInteractor.pinOwnStatus(statusId).then((status) => {
|
||||
if (!status.error) {
|
||||
commit('setPinned', { status })
|
||||
}
|
||||
return status
|
||||
})
|
||||
return rootState.api.backendInteractor.pinOwnStatus(statusId)
|
||||
.then((status) => commit('setPinned', { status }))
|
||||
},
|
||||
unpinStatus ({ rootState, commit }, statusId) {
|
||||
rootState.api.backendInteractor.unpinOwnStatus(statusId)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue