mirror of
https://github.com/AmanTahiliani/box-box.git
synced 2026-08-07 19:56:18 -04:00
10 lines
290 B
TypeScript
10 lines
290 B
TypeScript
|
|
import type { RaceHub } from './types'
|
||
|
|
|
||
|
|
export async function fetchRaceHub(sessionKey: number): Promise<RaceHub> {
|
||
|
|
const res = await fetch(`/api/v1/race-hub?session_key=${sessionKey}`)
|
||
|
|
if (!res.ok) {
|
||
|
|
throw new Error(`API ${res.status}: ${res.statusText}`)
|
||
|
|
}
|
||
|
|
return res.json()
|
||
|
|
}
|