feat(F-204): completed feature

This commit is contained in:
chattie
2026-08-24 15:55:15 +02:00
parent 9060e333ec
commit 7ec4628f3f
13 changed files with 58 additions and 29 deletions

View File

@@ -8,7 +8,8 @@ interface CmsPage {
status: string;
}
const BASE = process.env.NEXT_PUBLIC_API_URL ?? 'http://127.0.0.1:3000';
// Use env var if set, otherwise use relative URL (works for SSR and client-side via same-origin or CORS)
const BASE = process.env.NEXT_PUBLIC_API_URL || '';
export async function fetchCategories(): Promise<Category[]> {
const res = await fetch(`${BASE}/categories/tree`);