refs #577 Add unblock menu to unblock an account
This commit is contained in:
parent
b1d496993a
commit
a4abb6312d
|
@ -198,7 +198,9 @@ export default {
|
||||||
this.$store.dispatch('TimelineSpace/Contents/SideBar/AccountProfile/block', account)
|
this.$store.dispatch('TimelineSpace/Contents/SideBar/AccountProfile/block', account)
|
||||||
this.$refs.popper.doClose()
|
this.$refs.popper.doClose()
|
||||||
},
|
},
|
||||||
unblock () {
|
unblock (account) {
|
||||||
|
this.$store.dispatch('TimelineSpace/Contents/SideBar/AccountProfile/unblock', account)
|
||||||
|
this.$refs.popper.doClose()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -110,6 +110,17 @@ const AccountProfile = {
|
||||||
commit('changeRelationship', res.data)
|
commit('changeRelationship', res.data)
|
||||||
return 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
|
||||||
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue