[Glitch] refactor: Prevent leading slashes in API urls
Port c45ce549af to glitch-soc
Signed-off-by: Claire <claire.github-309c@sitedethib.com>
This commit is contained in:
1 parent
e5fa94886c
commit
e0d4e24071
3 files changed
+8
-7
No files matched your search
@@ -36,6 +36,6 @@ export const apiGetEndorsedAccounts = (id: string) =>
|
||||
apiRequestGet<ApiAccountJSON>(`v1/accounts/${id}/endorsements`);
|
||||
|
||||
export const apiGetFamiliarFollowers = (id: string) =>
|
||||
apiRequestGet<ApiFamiliarFollowersJSON>('/v1/accounts/familiar_followers', {
|
||||
apiRequestGet<ApiFamiliarFollowersJSON>('v1/accounts/familiar_followers', {
|
||||
id,
|
||||
});
|
||||
@@ -2,9 +2,9 @@ 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}`);
|
||||
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,
|
||||
});
|
||||
Reference in new issue
Block a user