refs #577 Add unblock menu to unblock an account

This commit is contained in:
AkiraFukushima 2018-09-13 00:43:28 +09:00
parent b1d496993a
commit a4abb6312d
2 changed files with 14 additions and 1 deletions

View File

@ -198,7 +198,9 @@ export default {
this.$store.dispatch('TimelineSpace/Contents/SideBar/AccountProfile/block', account)
this.$refs.popper.doClose()
},
unblock () {
unblock (account) {
this.$store.dispatch('TimelineSpace/Contents/SideBar/AccountProfile/unblock', account)
this.$refs.popper.doClose()
}
}
}

View File

@ -110,6 +110,17 @@ const AccountProfile = {
commit('changeRelationship', res.data)
return res.data
})
},
unblock ({ rootState, commit }, account) {
const client = new Mastodon(
rootState.TimelineSpace.account.accessToken,
rootState.TimelineSpace.account.baseURL + '/api/v1'
)
return client.post(`/accounts/${account.id}/unblock`)
.then(res => {
commit('changeRelationship', res.data)
return res.data
})
}
}
}