usable-but-buggy: picker, adding/removing reaction on click, search, styles
This commit is contained in:
parent
de945ba3e9
commit
33abbed5a1
7 changed files with 166 additions and 28 deletions
|
@ -72,6 +72,8 @@ const MASTODON_UNMUTE_CONVERSATION = id => `/api/v1/statuses/${id}/unmute`
|
|||
const MASTODON_SEARCH_2 = `/api/v2/search`
|
||||
const MASTODON_USER_SEARCH_URL = '/api/v1/accounts/search'
|
||||
const PLEROMA_EMOJI_REACTIONS_URL = id => `/api/v1/pleroma/statuses/${id}/emoji_reactions_by`
|
||||
const PLEROMA_EMOJI_REACT_URL = id => `/api/v1/pleroma/statuses/${id}/react_with_emoji`
|
||||
const PLEROMA_EMOJI_UNREACT_URL = id => `/api/v1/pleroma/statuses/${id}/unreact_with_emoji`
|
||||
|
||||
const oldfetch = window.fetch
|
||||
|
||||
|
@ -869,6 +871,24 @@ const fetchEmojiReactions = ({ id }) => {
|
|||
return promisedRequest({ url: PLEROMA_EMOJI_REACTIONS_URL(id) })
|
||||
}
|
||||
|
||||
const reactWithEmoji = ({ id, emoji, credentials }) => {
|
||||
return promisedRequest({
|
||||
url: PLEROMA_EMOJI_REACT_URL(id),
|
||||
method: 'POST',
|
||||
credentials,
|
||||
payload: { emoji }
|
||||
}).then(status => parseStatus(status))
|
||||
}
|
||||
|
||||
const unreactWithEmoji = ({ id, emoji, credentials }) => {
|
||||
return promisedRequest({
|
||||
url: PLEROMA_EMOJI_UNREACT_URL(id),
|
||||
method: 'POST',
|
||||
credentials,
|
||||
payload: { emoji }
|
||||
}).then(parseStatus)
|
||||
}
|
||||
|
||||
const reportUser = ({ credentials, userId, statusIds, comment, forward }) => {
|
||||
return promisedRequest({
|
||||
url: MASTODON_REPORT_USER_URL,
|
||||
|
@ -1003,6 +1023,8 @@ const apiService = {
|
|||
fetchFavoritedByUsers,
|
||||
fetchRebloggedByUsers,
|
||||
fetchEmojiReactions,
|
||||
reactWithEmoji,
|
||||
unreactWithEmoji,
|
||||
reportUser,
|
||||
updateNotificationSettings,
|
||||
search2,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue