2026-02-09 09:23:48 +01:00
|
|
|
import { api } from './client'
|
2026-02-09 11:00:37 +01:00
|
|
|
import type { Genlocke, GenlockeListItem, GenlockeDetail, GenlockeGraveyard, CreateGenlockeInput, Region } from '../types/game'
|
2026-02-09 10:39:59 +01:00
|
|
|
|
|
|
|
|
export function getGenlockes(): Promise<GenlockeListItem[]> {
|
|
|
|
|
return api.get('/genlockes')
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export function getGenlocke(id: number): Promise<GenlockeDetail> {
|
|
|
|
|
return api.get(`/genlockes/${id}`)
|
|
|
|
|
}
|
2026-02-09 09:23:48 +01:00
|
|
|
|
|
|
|
|
export function createGenlocke(data: CreateGenlockeInput): Promise<Genlocke> {
|
|
|
|
|
return api.post('/genlockes', data)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export function getGamesByRegion(): Promise<Region[]> {
|
|
|
|
|
return api.get('/games/by-region')
|
|
|
|
|
}
|
2026-02-09 09:47:28 +01:00
|
|
|
|
2026-02-09 11:00:37 +01:00
|
|
|
export function getGenlockeGraveyard(id: number): Promise<GenlockeGraveyard> {
|
|
|
|
|
return api.get(`/genlockes/${id}/graveyard`)
|
|
|
|
|
}
|
|
|
|
|
|
2026-02-09 09:47:28 +01:00
|
|
|
export function advanceLeg(genlockeId: number, legOrder: number): Promise<Genlocke> {
|
|
|
|
|
return api.post(`/genlockes/${genlockeId}/legs/${legOrder}/advance`, {})
|
|
|
|
|
}
|