added support hide\show reblogs from a specific user

This commit is contained in:
Maksim Pechnikov 2019-09-21 16:24:47 +03:00
parent 9b163d2816
commit 8721fb57fc
8 changed files with 58 additions and 6 deletions

View file

@ -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())

View file

@ -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) => {

View file

@ -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
}

View file

@ -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])