FEAT-3: litter type+CRUD, Zucht strings, /wuerfe nested routes (retire LittersPage)
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -1,7 +1,24 @@
|
||||
/** Typed API functions for the Würfe (litters) resource. */
|
||||
import { api, resources } from './client'
|
||||
import type { Litter } from './types'
|
||||
import { toQueryString, type GridifyQuery } from './gridify'
|
||||
import type { CreateLitter, Litter, Paged, UpdateLitter } from './types'
|
||||
|
||||
export function getLitter(id: string): Promise<Litter> {
|
||||
return api.get<Litter>(`${resources.litters}/${id}`)
|
||||
}
|
||||
|
||||
export function listLitters(query: GridifyQuery): Promise<Paged<Litter>> {
|
||||
return api.get<Paged<Litter>>(`${resources.litters}${toQueryString(query)}`)
|
||||
}
|
||||
|
||||
export function createLitter(body: CreateLitter): Promise<Litter> {
|
||||
return api.post<Litter>(resources.litters, body)
|
||||
}
|
||||
|
||||
export function updateLitter(id: string, body: UpdateLitter): Promise<Litter> {
|
||||
return api.put<Litter>(`${resources.litters}/${id}`, body)
|
||||
}
|
||||
|
||||
export function deleteLitter(id: string): Promise<void> {
|
||||
return api.delete(`${resources.litters}/${id}`)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user