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.
15 lines
567 B
TypeScript
15 lines
567 B
TypeScript
// frontend/lib/weekly/api.ts — 주간 리뷰 조회
|
|
import type { WeeklyReview } from "@/lib/types";
|
|
|
|
const BASE = process.env.NEXT_PUBLIC_API_BASE ?? (typeof window === "undefined" ? "http://localhost:31800" : "");
|
|
|
|
export async function getWeeklyReview(
|
|
week?: string,
|
|
signal?: AbortSignal,
|
|
): Promise<WeeklyReview> {
|
|
const qs = week ? `?week=${encodeURIComponent(week)}` : "";
|
|
const res = await fetch(`${BASE}/api/weekly-review${qs}`, { signal, cache: "no-store" });
|
|
if (!res.ok) throw new Error(`weekly-review ${res.status}`);
|
|
return res.json();
|
|
}
|