Files
goodgo-platform/apps/web/lib/khu-cong-nghiep-server.ts
Ho Ngoc Hai 7ce651fce5 feat(web): add khu-cong-nghiep, chuyen-nhuong, and reports pages
Add three new frontend page sections:
- Industrial parks (khu-cong-nghiep): listing, detail, filter bar
- Transfer listings (chuyen-nhuong): search, category tabs, detail
- AI reports dashboard: list, create, viewer with TOC

Includes components, API clients, hooks, server helpers, i18n keys,
navigation links in public and dashboard layouts, and lint fixes.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-04-16 09:07:45 +07:00

16 lines
496 B
TypeScript

import type { IndustrialParkDetail } from './khu-cong-nghiep-api';
const API_URL = process.env['NEXT_PUBLIC_API_URL'] ?? 'http://localhost:3001/api/v1';
export async function fetchIndustrialParkBySlug(slug: string): Promise<IndustrialParkDetail | null> {
try {
const res = await fetch(`${API_URL}/industrial/parks/${slug}`, {
next: { revalidate: 300 },
});
if (!res.ok) return null;
return res.json() as Promise<IndustrialParkDetail>;
} catch {
return null;
}
}