feat(F-204): completed feature
This commit is contained in:
@@ -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`);
|
||||
|
||||
Reference in New Issue
Block a user