diff options
| author | HJ <30-hj@users.noreply.git.pleroma.social> | 2019-07-15 06:50:31 +0000 |
|---|---|---|
| committer | HJ <30-hj@users.noreply.git.pleroma.social> | 2019-07-15 06:50:31 +0000 |
| commit | 0c064105841608c93649992eeb609e63b73ad595 (patch) | |
| tree | 1483d2fbdc42abe43aefefc9a27c25ecdcb68dcf /src/services/api/api.service.js | |
| parent | 0a7c60c30376dfa0bb3058b16f0e59485f5397c6 (diff) | |
| parent | ff90d864ccccd33e9d2cfb7ef64afa2486c537a0 (diff) | |
Merge branch '482-subscribe-user' into 'develop'
Implement ability to subscribe to a user
Closes #482
See merge request pleroma/pleroma-fe!771
Diffstat (limited to 'src/services/api/api.service.js')
| -rw-r--r-- | src/services/api/api.service.js | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/services/api/api.service.js b/src/services/api/api.service.js index 304fc869..e417cf29 100644 --- a/src/services/api/api.service.js +++ b/src/services/api/api.service.js @@ -55,6 +55,8 @@ 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_SUBSCRIBE_USER = id => `/api/v1/pleroma/accounts/${id}/subscribe` +const MASTODON_UNSUBSCRIBE_USER = id => `/api/v1/pleroma/accounts/${id}/unsubscribe` const MASTODON_POST_STATUS_URL = '/api/v1/statuses' const MASTODON_MEDIA_UPLOAD_URL = '/api/v1/media' const MASTODON_VOTE_URL = id => `/api/v1/polls/${id}/votes` @@ -752,6 +754,14 @@ const unmuteUser = ({ id, credentials }) => { return promisedRequest({ url: MASTODON_UNMUTE_USER_URL(id), credentials, method: 'POST' }) } +const subscribeUser = ({ id, credentials }) => { + return promisedRequest({ url: MASTODON_SUBSCRIBE_USER(id), credentials, method: 'POST' }) +} + +const unsubscribeUser = ({ id, credentials }) => { + return promisedRequest({ url: MASTODON_UNSUBSCRIBE_USER(id), credentials, method: 'POST' }) +} + const fetchBlocks = ({ credentials }) => { return promisedRequest({ url: MASTODON_USER_BLOCKS_URL, credentials }) .then((users) => users.map(parseUser)) @@ -882,6 +892,8 @@ const apiService = { fetchMutes, muteUser, unmuteUser, + subscribeUser, + unsubscribeUser, fetchBlocks, fetchOAuthTokens, revokeOAuthToken, |
