Update competition API routes to use /competitions prefix
continuous-integration/drone/push Build is passing Details

Harmonize all competition-related API endpoints to use plural
/competitions prefix for consistency with REST conventions.
master
Guillermo Pages 2 weeks ago
parent e6a10f7290
commit 5e020aa4eb

@ -88,7 +88,7 @@ function buildNetworkError(message: string): CompetitionApiResult<never> {
// ============================================================================ // ============================================================================
/** /**
* GET /competition/templates * GET /competitions/templates
* List competition templates * List competition templates
*/ */
export async function listTemplates( export async function listTemplates(
@ -101,7 +101,7 @@ export async function listTemplates(
if (filters?.sport_id !== undefined) params.set('sport_id', String(filters.sport_id)); if (filters?.sport_id !== undefined) params.set('sport_id', String(filters.sport_id));
if (filters?.include_inactive) params.set('include_inactive', 'true'); if (filters?.include_inactive) params.set('include_inactive', 'true');
const response = await apiFetch(`/competition/templates?${params}`, { const response = await apiFetch(`/competitions/templates?${params}`, {
method: 'GET', method: 'GET',
headers: { 'Content-Type': 'application/json' }, headers: { 'Content-Type': 'application/json' },
}); });
@ -117,14 +117,14 @@ export async function listTemplates(
} }
/** /**
* GET /competition/templates/{template_id} * GET /competitions/templates/{template_id}
* Get a single template * Get a single template
*/ */
export async function getTemplate( export async function getTemplate(
templateId: number templateId: number
): Promise<CompetitionApiResult<CompetitionTemplate>> { ): Promise<CompetitionApiResult<CompetitionTemplate>> {
try { try {
const response = await apiFetch(`/competition/templates/${templateId}`, { const response = await apiFetch(`/competitions/templates/${templateId}`, {
method: 'GET', method: 'GET',
headers: { 'Content-Type': 'application/json' }, headers: { 'Content-Type': 'application/json' },
}); });
@ -140,7 +140,7 @@ export async function getTemplate(
} }
/** /**
* POST /competition/templates * POST /competitionss/templates
* Create a new template * Create a new template
*/ */
export async function createTemplate( export async function createTemplate(
@ -148,7 +148,7 @@ export async function createTemplate(
request: CreateTemplateRequest request: CreateTemplateRequest
): Promise<CompetitionApiResult<CompetitionTemplate>> { ): Promise<CompetitionApiResult<CompetitionTemplate>> {
try { try {
const response = await apiFetch('/competition/templates', { const response = await apiFetch('/competitions/templates', {
method: 'POST', method: 'POST',
headers: { 'Content-Type': 'application/json' }, headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ ...request, facility_id: facilityId }), body: JSON.stringify({ ...request, facility_id: facilityId }),
@ -165,7 +165,7 @@ export async function createTemplate(
} }
/** /**
* PATCH /competition/templates/{template_id} * PATCH /competitions/templates/{template_id}
* Update a template * Update a template
*/ */
export async function updateTemplate( export async function updateTemplate(
@ -173,7 +173,7 @@ export async function updateTemplate(
request: UpdateTemplateRequest request: UpdateTemplateRequest
): Promise<CompetitionApiResult<CompetitionTemplate>> { ): Promise<CompetitionApiResult<CompetitionTemplate>> {
try { try {
const response = await apiFetch(`/competition/templates/${templateId}`, { const response = await apiFetch(`/competitions/templates/${templateId}`, {
method: 'PATCH', method: 'PATCH',
headers: { 'Content-Type': 'application/json' }, headers: { 'Content-Type': 'application/json' },
body: JSON.stringify(request), body: JSON.stringify(request),
@ -224,14 +224,14 @@ export async function listCompetitions(
} }
/** /**
* GET /competition/{competition_id} * GET /competitions/{competition_id}
* Get competition with stages * Get competition with stages
*/ */
export async function getCompetition( export async function getCompetition(
competitionId: number competitionId: number
): Promise<CompetitionApiResult<Competition>> { ): Promise<CompetitionApiResult<Competition>> {
try { try {
const response = await apiFetch(`/competition/${competitionId}`, { const response = await apiFetch(`/competitions/${competitionId}`, {
method: 'GET', method: 'GET',
headers: { 'Content-Type': 'application/json' }, headers: { 'Content-Type': 'application/json' },
}); });
@ -247,7 +247,7 @@ export async function getCompetition(
} }
/** /**
* POST /competition * POST /competitions
* Create a new competition * Create a new competition
*/ */
export async function createCompetition( export async function createCompetition(
@ -255,7 +255,7 @@ export async function createCompetition(
request: CreateCompetitionRequest request: CreateCompetitionRequest
): Promise<CompetitionApiResult<Competition>> { ): Promise<CompetitionApiResult<Competition>> {
try { try {
const response = await apiFetch('/competition', { const response = await apiFetch('/competitions', {
method: 'POST', method: 'POST',
headers: { 'Content-Type': 'application/json' }, headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ ...request, facility_id: facilityId }), body: JSON.stringify({ ...request, facility_id: facilityId }),
@ -272,7 +272,7 @@ export async function createCompetition(
} }
/** /**
* PATCH /competition/{competition_id} * PATCH /competitions/{competition_id}
* Update a competition * Update a competition
*/ */
export async function updateCompetition( export async function updateCompetition(
@ -280,7 +280,7 @@ export async function updateCompetition(
request: UpdateCompetitionRequest request: UpdateCompetitionRequest
): Promise<CompetitionApiResult<Competition>> { ): Promise<CompetitionApiResult<Competition>> {
try { try {
const response = await apiFetch(`/competition/${competitionId}`, { const response = await apiFetch(`/competitions/${competitionId}`, {
method: 'PATCH', method: 'PATCH',
headers: { 'Content-Type': 'application/json' }, headers: { 'Content-Type': 'application/json' },
body: JSON.stringify(request), body: JSON.stringify(request),
@ -297,14 +297,14 @@ export async function updateCompetition(
} }
/** /**
* POST /competition/{competition_id}/publish * POST /competitions/{competition_id}/publish
* Publish a competition (draft -> published) * Publish a competition (draft -> published)
*/ */
export async function publishCompetition( export async function publishCompetition(
competitionId: number competitionId: number
): Promise<CompetitionApiResult<Competition>> { ): Promise<CompetitionApiResult<Competition>> {
try { try {
const response = await apiFetch(`/competition/${competitionId}/publish`, { const response = await apiFetch(`/competitions/${competitionId}/publish`, {
method: 'POST', method: 'POST',
headers: { 'Content-Type': 'application/json' }, headers: { 'Content-Type': 'application/json' },
}); });
@ -320,14 +320,14 @@ export async function publishCompetition(
} }
/** /**
* POST /competition/{competition_id}/start * POST /competitions/{competition_id}/start
* Start a competition (published -> running) * Start a competition (published -> running)
*/ */
export async function startCompetition( export async function startCompetition(
competitionId: number competitionId: number
): Promise<CompetitionApiResult<Competition>> { ): Promise<CompetitionApiResult<Competition>> {
try { try {
const response = await apiFetch(`/competition/${competitionId}/start`, { const response = await apiFetch(`/competitions/${competitionId}/start`, {
method: 'POST', method: 'POST',
headers: { 'Content-Type': 'application/json' }, headers: { 'Content-Type': 'application/json' },
}); });
@ -343,14 +343,14 @@ export async function startCompetition(
} }
/** /**
* POST /competition/{competition_id}/finish * POST /competitions/{competition_id}/finish
* Finish a competition (running -> finished) * Finish a competition (running -> finished)
*/ */
export async function finishCompetition( export async function finishCompetition(
competitionId: number competitionId: number
): Promise<CompetitionApiResult<Competition>> { ): Promise<CompetitionApiResult<Competition>> {
try { try {
const response = await apiFetch(`/competition/${competitionId}/finish`, { const response = await apiFetch(`/competitions/${competitionId}/finish`, {
method: 'POST', method: 'POST',
headers: { 'Content-Type': 'application/json' }, headers: { 'Content-Type': 'application/json' },
}); });
@ -366,14 +366,14 @@ export async function finishCompetition(
} }
/** /**
* POST /competition/{competition_id}/cancel * POST /competitions/{competition_id}/cancel
* Cancel a competition * Cancel a competition
*/ */
export async function cancelCompetition( export async function cancelCompetition(
competitionId: number competitionId: number
): Promise<CompetitionApiResult<Competition>> { ): Promise<CompetitionApiResult<Competition>> {
try { try {
const response = await apiFetch(`/competition/${competitionId}/cancel`, { const response = await apiFetch(`/competitions/${competitionId}/cancel`, {
method: 'POST', method: 'POST',
headers: { 'Content-Type': 'application/json' }, headers: { 'Content-Type': 'application/json' },
}); });
@ -393,7 +393,7 @@ export async function cancelCompetition(
// ============================================================================ // ============================================================================
/** /**
* GET /competition/{competition_id}/registrations * GET /competitions/{competition_id}/registrations
* List registrations for a competition * List registrations for a competition
*/ */
export async function listRegistrations( export async function listRegistrations(
@ -405,7 +405,7 @@ export async function listRegistrations(
if (filters?.status) params.set('status', filters.status); if (filters?.status) params.set('status', filters.status);
const queryString = params.toString(); const queryString = params.toString();
const endpoint = `/competition/${competitionId}/registrations${queryString ? `?${queryString}` : ''}`; const endpoint = `/competitions/${competitionId}/registrations${queryString ? `?${queryString}` : ''}`;
const response = await apiFetch(endpoint, { const response = await apiFetch(endpoint, {
method: 'GET', method: 'GET',
@ -423,7 +423,7 @@ export async function listRegistrations(
} }
/** /**
* POST /competition/{competition_id}/registrations/{registration_id}/approve * POST /competitions/{competition_id}/registrations/{registration_id}/approve
* Approve a registration * Approve a registration
*/ */
export async function approveRegistration( export async function approveRegistration(
@ -432,7 +432,7 @@ export async function approveRegistration(
): Promise<CompetitionApiResult<{ participant_id: number }>> { ): Promise<CompetitionApiResult<{ participant_id: number }>> {
try { try {
const response = await apiFetch( const response = await apiFetch(
`/competition/${competitionId}/registrations/${registrationId}/approve`, `/competitions/${competitionId}/registrations/${registrationId}/approve`,
{ {
method: 'POST', method: 'POST',
headers: { 'Content-Type': 'application/json' }, headers: { 'Content-Type': 'application/json' },
@ -446,7 +446,7 @@ export async function approveRegistration(
} }
/** /**
* POST /competition/{competition_id}/registrations/{registration_id}/reject * POST /competitions/{competition_id}/registrations/{registration_id}/reject
* Reject a registration * Reject a registration
*/ */
export async function rejectRegistration( export async function rejectRegistration(
@ -455,7 +455,7 @@ export async function rejectRegistration(
): Promise<CompetitionApiResult<void>> { ): Promise<CompetitionApiResult<void>> {
try { try {
const response = await apiFetch( const response = await apiFetch(
`/competition/${competitionId}/registrations/${registrationId}/reject`, `/competitions/${competitionId}/registrations/${registrationId}/reject`,
{ {
method: 'POST', method: 'POST',
headers: { 'Content-Type': 'application/json' }, headers: { 'Content-Type': 'application/json' },
@ -473,7 +473,7 @@ export async function rejectRegistration(
// ============================================================================ // ============================================================================
/** /**
* GET /competition/{competition_id}/participants * GET /competitions/{competition_id}/participants
* List participants for a competition * List participants for a competition
*/ */
export async function listParticipants( export async function listParticipants(
@ -486,7 +486,7 @@ export async function listParticipants(
if (filters?.stage_group_id !== undefined) params.set('stage_group_id', String(filters.stage_group_id)); if (filters?.stage_group_id !== undefined) params.set('stage_group_id', String(filters.stage_group_id));
const queryString = params.toString(); const queryString = params.toString();
const endpoint = `/competition/${competitionId}/participants${queryString ? `?${queryString}` : ''}`; const endpoint = `/competitions/${competitionId}/participants${queryString ? `?${queryString}` : ''}`;
const response = await apiFetch(endpoint, { const response = await apiFetch(endpoint, {
method: 'GET', method: 'GET',
@ -504,7 +504,7 @@ export async function listParticipants(
} }
/** /**
* POST /competition/{competition_id}/participants * POST /competitions/{competition_id}/participants
* Create a participant manually (without registration) * Create a participant manually (without registration)
*/ */
export async function createParticipant( export async function createParticipant(
@ -512,7 +512,7 @@ export async function createParticipant(
request: CreateParticipantRequest request: CreateParticipantRequest
): Promise<CompetitionApiResult<CompetitionParticipant>> { ): Promise<CompetitionApiResult<CompetitionParticipant>> {
try { try {
const response = await apiFetch(`/competition/${competitionId}/participants`, { const response = await apiFetch(`/competitions/${competitionId}/participants`, {
method: 'POST', method: 'POST',
headers: { 'Content-Type': 'application/json' }, headers: { 'Content-Type': 'application/json' },
body: JSON.stringify(request), body: JSON.stringify(request),
@ -529,7 +529,7 @@ export async function createParticipant(
} }
/** /**
* POST /competition/participants/{participant_id}/assign-group * POST /competitions/participants/{participant_id}/assign-group
* Assign a participant to a group * Assign a participant to a group
*/ */
export async function assignParticipantToGroup( export async function assignParticipantToGroup(
@ -537,7 +537,7 @@ export async function assignParticipantToGroup(
groupId: number groupId: number
): Promise<CompetitionApiResult<void>> { ): Promise<CompetitionApiResult<void>> {
try { try {
const response = await apiFetch(`/competition/participants/${participantId}/assign-group`, { const response = await apiFetch(`/competitions/participants/${participantId}/assign-group`, {
method: 'POST', method: 'POST',
headers: { 'Content-Type': 'application/json' }, headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ group_id: groupId }), body: JSON.stringify({ group_id: groupId }),
@ -550,7 +550,7 @@ export async function assignParticipantToGroup(
} }
/** /**
* POST /competition/participants/{participant_id}/seed * POST /competitions/participants/{participant_id}/seed
* Set participant seed * Set participant seed
*/ */
export async function setParticipantSeed( export async function setParticipantSeed(
@ -558,7 +558,7 @@ export async function setParticipantSeed(
seed: number seed: number
): Promise<CompetitionApiResult<void>> { ): Promise<CompetitionApiResult<void>> {
try { try {
const response = await apiFetch(`/competition/participants/${participantId}/seed`, { const response = await apiFetch(`/competitions/participants/${participantId}/seed`, {
method: 'POST', method: 'POST',
headers: { 'Content-Type': 'application/json' }, headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ seed }), body: JSON.stringify({ seed }),
@ -571,14 +571,14 @@ export async function setParticipantSeed(
} }
/** /**
* POST /competition/participants/{participant_id}/withdraw * POST /competitions/participants/{participant_id}/withdraw
* Withdraw a participant * Withdraw a participant
*/ */
export async function withdrawParticipant( export async function withdrawParticipant(
participantId: number participantId: number
): Promise<CompetitionApiResult<void>> { ): Promise<CompetitionApiResult<void>> {
try { try {
const response = await apiFetch(`/competition/participants/${participantId}/withdraw`, { const response = await apiFetch(`/competitions/participants/${participantId}/withdraw`, {
method: 'POST', method: 'POST',
headers: { 'Content-Type': 'application/json' }, headers: { 'Content-Type': 'application/json' },
}); });
@ -594,7 +594,7 @@ export async function withdrawParticipant(
// ============================================================================ // ============================================================================
/** /**
* POST /competition/{competition_id}/stages/{stage_id}/generate-fixtures * POST /competitions/{competition_id}/stages/{stage_id}/generate-fixtures
* Generate fixtures for a stage * Generate fixtures for a stage
*/ */
export async function generateFixtures( export async function generateFixtures(
@ -604,7 +604,7 @@ export async function generateFixtures(
): Promise<CompetitionApiResult<{ match_count: number; match_ids: number[] }>> { ): Promise<CompetitionApiResult<{ match_count: number; match_ids: number[] }>> {
try { try {
const response = await apiFetch( const response = await apiFetch(
`/competition/${competitionId}/stages/${stageId}/generate-fixtures`, `/competitions/${competitionId}/stages/${stageId}/generate-fixtures`,
{ {
method: 'POST', method: 'POST',
headers: { 'Content-Type': 'application/json' }, headers: { 'Content-Type': 'application/json' },
@ -619,7 +619,7 @@ export async function generateFixtures(
} }
/** /**
* GET /competition/{competition_id}/stages/{stage_id}/fixtures * GET /competitions/{competition_id}/stages/{stage_id}/fixtures
* List fixtures for a stage * List fixtures for a stage
*/ */
export async function listFixtures( export async function listFixtures(
@ -633,7 +633,7 @@ export async function listFixtures(
if (filters?.round_index !== undefined) params.set('round_index', String(filters.round_index)); if (filters?.round_index !== undefined) params.set('round_index', String(filters.round_index));
const queryString = params.toString(); const queryString = params.toString();
const endpoint = `/competition/${competitionId}/stages/${stageId}/fixtures${queryString ? `?${queryString}` : ''}`; const endpoint = `/competitions/${competitionId}/stages/${stageId}/fixtures${queryString ? `?${queryString}` : ''}`;
const response = await apiFetch(endpoint, { const response = await apiFetch(endpoint, {
method: 'GET', method: 'GET',
@ -651,14 +651,14 @@ export async function listFixtures(
} }
/** /**
* GET /competition/matches/{match_id} * GET /competitions/matches/{match_id}
* Get a single match * Get a single match
*/ */
export async function getMatch( export async function getMatch(
matchId: number matchId: number
): Promise<CompetitionApiResult<CompetitionMatch>> { ): Promise<CompetitionApiResult<CompetitionMatch>> {
try { try {
const response = await apiFetch(`/competition/matches/${matchId}`, { const response = await apiFetch(`/competitions/matches/${matchId}`, {
method: 'GET', method: 'GET',
headers: { 'Content-Type': 'application/json' }, headers: { 'Content-Type': 'application/json' },
}); });
@ -674,7 +674,7 @@ export async function getMatch(
} }
/** /**
* POST /competition/matches/{match_id}/link-slot * POST /competitions/matches/{match_id}/link-slot
* Link a match to a slot instance * Link a match to a slot instance
*/ */
export async function linkMatchToSlot( export async function linkMatchToSlot(
@ -682,7 +682,7 @@ export async function linkMatchToSlot(
request: LinkSlotRequest request: LinkSlotRequest
): Promise<CompetitionApiResult<void>> { ): Promise<CompetitionApiResult<void>> {
try { try {
const response = await apiFetch(`/competition/matches/${matchId}/link-slot`, { const response = await apiFetch(`/competitions/matches/${matchId}/link-slot`, {
method: 'POST', method: 'POST',
headers: { 'Content-Type': 'application/json' }, headers: { 'Content-Type': 'application/json' },
body: JSON.stringify(request), body: JSON.stringify(request),
@ -695,14 +695,14 @@ export async function linkMatchToSlot(
} }
/** /**
* POST /competition/matches/{match_id}/unlink-slot * POST /competitions/matches/{match_id}/unlink-slot
* Unlink a match from its slot instance * Unlink a match from its slot instance
*/ */
export async function unlinkMatchFromSlot( export async function unlinkMatchFromSlot(
matchId: number matchId: number
): Promise<CompetitionApiResult<void>> { ): Promise<CompetitionApiResult<void>> {
try { try {
const response = await apiFetch(`/competition/matches/${matchId}/unlink-slot`, { const response = await apiFetch(`/competitions/matches/${matchId}/unlink-slot`, {
method: 'POST', method: 'POST',
headers: { 'Content-Type': 'application/json' }, headers: { 'Content-Type': 'application/json' },
}); });
@ -714,7 +714,7 @@ export async function unlinkMatchFromSlot(
} }
/** /**
* POST /competition/matches/{match_id}/set-winner * POST /competitions/matches/{match_id}/set-winner
* Manually set match winner * Manually set match winner
*/ */
export async function setMatchWinner( export async function setMatchWinner(
@ -722,7 +722,7 @@ export async function setMatchWinner(
request: SetWinnerRequest request: SetWinnerRequest
): Promise<CompetitionApiResult<void>> { ): Promise<CompetitionApiResult<void>> {
try { try {
const response = await apiFetch(`/competition/matches/${matchId}/set-winner`, { const response = await apiFetch(`/competitions/matches/${matchId}/set-winner`, {
method: 'POST', method: 'POST',
headers: { 'Content-Type': 'application/json' }, headers: { 'Content-Type': 'application/json' },
body: JSON.stringify(request), body: JSON.stringify(request),
@ -735,14 +735,14 @@ export async function setMatchWinner(
} }
/** /**
* POST /competition/matches/{match_id}/void * POST /competitions/matches/{match_id}/void
* Void a match * Void a match
*/ */
export async function voidMatch( export async function voidMatch(
matchId: number matchId: number
): Promise<CompetitionApiResult<void>> { ): Promise<CompetitionApiResult<void>> {
try { try {
const response = await apiFetch(`/competition/matches/${matchId}/void`, { const response = await apiFetch(`/competitions/matches/${matchId}/void`, {
method: 'POST', method: 'POST',
headers: { 'Content-Type': 'application/json' }, headers: { 'Content-Type': 'application/json' },
}); });
@ -758,7 +758,7 @@ export async function voidMatch(
// ============================================================================ // ============================================================================
/** /**
* GET /competition/{competition_id}/stages/{stage_id}/standings * GET /competitions/{competition_id}/stages/{stage_id}/standings
* Get standings for a stage * Get standings for a stage
*/ */
export async function getStandings( export async function getStandings(
@ -771,7 +771,7 @@ export async function getStandings(
if (filters?.group_id !== undefined) params.set('group_id', String(filters.group_id)); if (filters?.group_id !== undefined) params.set('group_id', String(filters.group_id));
const queryString = params.toString(); const queryString = params.toString();
const endpoint = `/competition/${competitionId}/stages/${stageId}/standings${queryString ? `?${queryString}` : ''}`; const endpoint = `/competitions/${competitionId}/stages/${stageId}/standings${queryString ? `?${queryString}` : ''}`;
const response = await apiFetch(endpoint, { const response = await apiFetch(endpoint, {
method: 'GET', method: 'GET',
@ -789,7 +789,7 @@ export async function getStandings(
} }
/** /**
* POST /competition/{competition_id}/stages/{stage_id}/standings/recalculate * POST /competitions/{competition_id}/stages/{stage_id}/standings/recalculate
* Recalculate standings * Recalculate standings
*/ */
export async function recalculateStandings( export async function recalculateStandings(
@ -799,7 +799,7 @@ export async function recalculateStandings(
): Promise<CompetitionApiResult<{ participant_count: number }>> { ): Promise<CompetitionApiResult<{ participant_count: number }>> {
try { try {
const response = await apiFetch( const response = await apiFetch(
`/competition/${competitionId}/stages/${stageId}/standings/recalculate`, `/competitions/${competitionId}/stages/${stageId}/standings/recalculate`,
{ {
method: 'POST', method: 'POST',
headers: { 'Content-Type': 'application/json' }, headers: { 'Content-Type': 'application/json' },
@ -818,7 +818,7 @@ export async function recalculateStandings(
// ============================================================================ // ============================================================================
/** /**
* GET /competition/{competition_id}/stages/{stage_id}/leaderboard * GET /competitions/{competition_id}/stages/{stage_id}/leaderboard
* Get leaderboard for a challenge stage * Get leaderboard for a challenge stage
*/ */
export async function getLeaderboard( export async function getLeaderboard(
@ -833,7 +833,7 @@ export async function getLeaderboard(
if (offset !== 0) params.set('offset', String(offset)); if (offset !== 0) params.set('offset', String(offset));
const queryString = params.toString(); const queryString = params.toString();
const endpoint = `/competition/${competitionId}/stages/${stageId}/leaderboard${queryString ? `?${queryString}` : ''}`; const endpoint = `/competitions/${competitionId}/stages/${stageId}/leaderboard${queryString ? `?${queryString}` : ''}`;
const response = await apiFetch(endpoint, { const response = await apiFetch(endpoint, {
method: 'GET', method: 'GET',
@ -847,7 +847,7 @@ export async function getLeaderboard(
} }
/** /**
* POST /competition/{competition_id}/stages/{stage_id}/leaderboard/recalculate * POST /competitions/{competition_id}/stages/{stage_id}/leaderboard/recalculate
* Recalculate leaderboard * Recalculate leaderboard
*/ */
export async function recalculateLeaderboard( export async function recalculateLeaderboard(
@ -856,7 +856,7 @@ export async function recalculateLeaderboard(
): Promise<CompetitionApiResult<{ entry_count: number }>> { ): Promise<CompetitionApiResult<{ entry_count: number }>> {
try { try {
const response = await apiFetch( const response = await apiFetch(
`/competition/${competitionId}/stages/${stageId}/leaderboard/recalculate`, `/competitions/${competitionId}/stages/${stageId}/leaderboard/recalculate`,
{ {
method: 'POST', method: 'POST',
headers: { 'Content-Type': 'application/json' }, headers: { 'Content-Type': 'application/json' },

Loading…
Cancel
Save