diff options
| author | Tusooa Zhu <tusooa@kazv.moe> | 2022-08-20 13:18:57 -0400 |
|---|---|---|
| committer | tusooa <tusooa@kazv.moe> | 2022-12-21 23:17:39 -0500 |
| commit | 9f51517ecdee7de0e9288eb94e6ecf70fd161eb3 (patch) | |
| tree | c058096b6d7468ad9c7101548fa9189d695fede0 /src/services/api/api.service.js | |
| parent | 1101305ffb72bacd68698bfbe6e961953a9043de (diff) | |
Make API requests to edit note
Diffstat (limited to 'src/services/api/api.service.js')
| -rw-r--r-- | src/services/api/api.service.js | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/services/api/api.service.js b/src/services/api/api.service.js index df652ae1..7174cc5d 100644 --- a/src/services/api/api.service.js +++ b/src/services/api/api.service.js @@ -70,6 +70,7 @@ 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_USER_NOTE_URL = id => `/api/v1/accounts/${id}/note` const MASTODON_BOOKMARK_STATUS_URL = id => `/api/v1/statuses/${id}/bookmark` const MASTODON_UNBOOKMARK_STATUS_URL = id => `/api/v1/statuses/${id}/unbookmark` const MASTODON_POST_STATUS_URL = '/api/v1/statuses' @@ -321,6 +322,17 @@ const removeUserFromFollowers = ({ id, credentials }) => { }).then((data) => data.json()) } +const editUserNote = ({ id, credentials, comment }) => { + return promisedRequest({ + url: MASTODON_USER_NOTE_URL(id), + credentials, + payload: { + comment + }, + method: 'POST' + }) +} + const approveUser = ({ id, credentials }) => { const url = MASTODON_APPROVE_USER_URL(id) return fetch(url, { @@ -1667,6 +1679,7 @@ const apiService = { blockUser, unblockUser, removeUserFromFollowers, + editUserNote, fetchUser, fetchUserByName, fetchUserRelationship, |
