[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:
diondiondion authored and Claire committed 2025-05-14 14:05:22 +02:00
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 -2
View File
@@ -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,
});