refactor: Prevent leading slashes in API urls (#34680)
This commit is contained in:
parent
8d5b73d70d
commit
c45ce549af
3 changed files with 8 additions and 7 deletions
|
@ -2,9 +2,9 @@ import { apiRequestGet, apiRequestPost } from 'mastodon/api';
|
|||
import type { ApiPollJSON } from 'mastodon/api_types/polls';
|
||||
|
||||
export const apiGetPoll = (pollId: string) =>
|
||||
apiRequestGet<ApiPollJSON>(`/v1/polls/${pollId}`);
|
||||
apiRequestGet<ApiPollJSON>(`v1/polls/${pollId}`);
|
||||
|
||||
export const apiPollVote = (pollId: string, choices: string[]) =>
|
||||
apiRequestPost<ApiPollJSON>(`/v1/polls/${pollId}/votes`, {
|
||||
apiRequestPost<ApiPollJSON>(`v1/polls/${pollId}/votes`, {
|
||||
choices,
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue