aah/client/lib/api.ts

14 lines
357 B
TypeScript
Raw Normal View History

2023-08-07 23:36:33 +00:00
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;
}