aah/client/lib/api.ts
2023-08-07 18:36:33 -05:00

14 lines
357 B
TypeScript

export async function getServices() {
const response = await fetch("/api/service/list");
const body = await response.json();
console.log(body);
const { services } = body;
return services;
}
export async function getService(id: number) {
const response = await fetch(`/api/service/${id}`);
const body = await response.json();
return body;
}