mirror of
https://git.shipoclu.com/moon/plspace.git
synced 2026-08-13 02:42:30 +00:00
reacts and custom emoji reacts
This commit is contained in:
@@ -314,6 +314,26 @@ export function reblogStatus(api: ApiClient, id: string, on: boolean): Promise<S
|
||||
return api.post<Status>(`/api/v1/statuses/${encodeURIComponent(id)}/${action}`)
|
||||
}
|
||||
|
||||
/**
|
||||
* Add or remove one of the reactions already present on a status.
|
||||
*
|
||||
* Pleroma and Akkoma share this endpoint. `emoji` can be a Unicode emoji, a
|
||||
* local custom shortcode, or the server-qualified `shortcode@host` returned in
|
||||
* `pleroma.emoji_reactions`.
|
||||
*/
|
||||
export async function setEmojiReaction(
|
||||
api: ApiClient,
|
||||
id: string,
|
||||
emoji: string,
|
||||
on: boolean,
|
||||
): Promise<Status> {
|
||||
const path =
|
||||
`/api/v1/pleroma/statuses/${encodeURIComponent(id)}` +
|
||||
`/reactions/${encodeURIComponent(emoji)}`
|
||||
const { data } = await api.raw<Status>(path, { method: on ? 'PUT' : 'DELETE' })
|
||||
return data
|
||||
}
|
||||
|
||||
export function votePoll(api: ApiClient, id: string, choices: number[]): Promise<Poll> {
|
||||
return api.post<Poll>(`/api/v1/polls/${encodeURIComponent(id)}/votes`, { choices })
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user