Add invite links
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import client from './client'
|
||||
import type { Marathon, MarathonListItem, LeaderboardEntry, ParticipantWithUser, ParticipantRole, GameProposalMode } from '@/types'
|
||||
import type { Marathon, MarathonListItem, MarathonPublicInfo, LeaderboardEntry, ParticipantWithUser, ParticipantRole, GameProposalMode } from '@/types'
|
||||
|
||||
export interface CreateMarathonData {
|
||||
title: string
|
||||
@@ -21,6 +21,12 @@ export const marathonsApi = {
|
||||
return response.data
|
||||
},
|
||||
|
||||
getByCode: async (inviteCode: string): Promise<MarathonPublicInfo> => {
|
||||
// Public endpoint - no auth required
|
||||
const response = await client.get<MarathonPublicInfo>(`/marathons/by-code/${inviteCode}`)
|
||||
return response.data
|
||||
},
|
||||
|
||||
create: async (data: CreateMarathonData): Promise<Marathon> => {
|
||||
const response = await client.post<Marathon>('/marathons', data)
|
||||
return response.data
|
||||
|
||||
Reference in New Issue
Block a user