mirror of
https://github.com/glitch-soc/mastodon.git
synced 2025-12-13 15:58:50 +00:00
11 lines
382 B
TypeScript
11 lines
382 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,
|
|
});
|