You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

12 lines
403 B
TypeScript

// frontend/lib/journey/api.ts — GET /api/journey (작업·일정·사람 집계 read-model)
import type { Journey } from "@/lib/types";
async function ok<T>(r: Response): Promise<T> {
if (!r.ok) throw new Error(`${r.status} ${r.statusText}`);
return r.json() as Promise<T>;
}
export const journeyApi = {
get: () => fetch("/api/journey", { cache: "no-store" }).then((r) => ok<Journey>(r)),
};