export async function fetchCentering(id: number) {
const client = getClient();
const result = await client.api.app.centering[':id'].$get({
param: { id }
});
const parsed = await parseResult(result);
return parsed;
}
async function parseResult(result) {
if (!result.ok) {
const errorData = await result.text();
throw new Error(errorData || 'Failed');
}
return await result.json();
}
export async function fetchCentering(id: number) {
const client = getClient();
const result = await client.api.app.centering[':id'].$get({
param: { id }
});
const parsed = await parseResult(result);
return parsed;
}
async function parseResult(result) {
if (!result.ok) {
const errorData = await result.text();
throw new Error(errorData || 'Failed');
}
return await result.json();
}