added support hide\show reblogs from a specific user
This commit is contained in:
parent
9b163d2816
commit
8721fb57fc
8 changed files with 58 additions and 6 deletions
|
@ -219,9 +219,12 @@ const authHeaders = (accessToken) => {
|
|||
}
|
||||
}
|
||||
|
||||
const followUser = ({ id, credentials }) => {
|
||||
const followUser = ({ id, reblogs, credentials }) => {
|
||||
let url = MASTODON_FOLLOW_URL(id)
|
||||
const form = new FormData()
|
||||
if (reblogs !== undefined) { form.append('reblogs', reblogs) }
|
||||
return fetch(url, {
|
||||
body: form,
|
||||
headers: authHeaders(credentials),
|
||||
method: 'POST'
|
||||
}).then((data) => data.json())
|
||||
|
|
|
@ -31,8 +31,8 @@ const backendInteractorService = credentials => {
|
|||
return apiService.fetchUserRelationship({ id, credentials })
|
||||
}
|
||||
|
||||
const followUser = (id) => {
|
||||
return apiService.followUser({ credentials, id })
|
||||
const followUser = ({ id, reblogs }) => {
|
||||
return apiService.followUser({ credentials, id, reblogs })
|
||||
}
|
||||
|
||||
const unfollowUser = (id) => {
|
||||
|
|
|
@ -69,6 +69,7 @@ export const parseUser = (data) => {
|
|||
output.following = relationship.following
|
||||
output.statusnet_blocking = relationship.blocking
|
||||
output.muted = relationship.muting
|
||||
output.showing_reblogs = relationship.showing_reblogs
|
||||
output.subscribed = relationship.subscribing
|
||||
}
|
||||
|
||||
|
|
|
@ -14,7 +14,7 @@ const fetchUser = (attempt, user, store) => new Promise((resolve, reject) => {
|
|||
})
|
||||
|
||||
export const requestFollow = (user, store) => new Promise((resolve, reject) => {
|
||||
store.state.api.backendInteractor.followUser(user.id)
|
||||
store.state.api.backendInteractor.followUser({ id: user.id })
|
||||
.then((updated) => {
|
||||
store.commit('updateUserRelationship', [updated])
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue