mirror of
https://github.com/glitch-soc/mastodon.git
synced 2025-02-04 05:53:07 -05:00
e5dc03a353
Port da279df8ae029de80eb4709e1abdb95f132d5cfc to glitch-soc Signed-off-by: Claire <claire.github-309c@sitedethib.com>
11 lines
384 B
TypeScript
11 lines
384 B
TypeScript
import { apiRequestGet, apiRequestPost } from 'flavours/glitch/api';
|
|
import type { ApiPollJSON } from 'flavours/glitch/api_types/polls';
|
|
|
|
export const apiGetPoll = (pollId: string) =>
|
|
apiRequestGet<ApiPollJSON>(`/v1/polls/${pollId}`);
|
|
|
|
export const apiPollVote = (pollId: string, choices: string[]) =>
|
|
apiRequestPost<ApiPollJSON>(`/v1/polls/${pollId}/votes`, {
|
|
choices,
|
|
});
|