Added support for removing users from followers

This commit is contained in:
Sean King 2022-09-15 22:02:58 -06:00 committed by FloatingGhost
parent 4f837f75ea
commit 2453a338be
5 changed files with 28 additions and 0 deletions

View file

@ -68,6 +68,7 @@ const MASTODON_BLOCK_USER_URL = id => `/api/v1/accounts/${id}/block`
const MASTODON_UNBLOCK_USER_URL = id => `/api/v1/accounts/${id}/unblock`
const MASTODON_MUTE_USER_URL = id => `/api/v1/accounts/${id}/mute`
const MASTODON_UNMUTE_USER_URL = id => `/api/v1/accounts/${id}/unmute`
const MASTODON_REMOVE_USER_FROM_FOLLOWERS = id => `/api/v1/accounts/${id}/remove_from_followers`
const MASTODON_SUBSCRIBE_USER = id => `/api/v1/pleroma/accounts/${id}/subscribe`
const MASTODON_UNSUBSCRIBE_USER = id => `/api/v1/pleroma/accounts/${id}/unsubscribe`
const MASTODON_SET_NOTE_URL = id => `/api/v1/accounts/${id}/note`
@ -305,6 +306,13 @@ const unblockUser = ({ id, credentials }) => {
}).then((data) => data.json())
}
const removeUserFromFollowers = ({ id, credentials }) => {
return fetch(MASTODON_REMOVE_USER_FROM_FOLLOWERS(id), {
headers: authHeaders(credentials),
method: 'POST'
}).then((data) => data.json())
}
const approveUser = ({ id, credentials }) => {
let url = MASTODON_APPROVE_USER_URL(id)
return fetch(url, {
@ -1625,6 +1633,7 @@ const apiService = {
unmuteConversation,
blockUser,
unblockUser,
removeUserFromFollowers,
fetchUser,
fetchUserRelationship,
favorite,