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>
16 lines
493 B
TypeScript
16 lines
493 B
TypeScript
import type { TransferListingDetail } from './chuyen-nhuong-api';
|
|
|
|
const API_URL = process.env['NEXT_PUBLIC_API_URL'] ?? 'http://localhost:3001/api/v1';
|
|
|
|
export async function fetchTransferListingById(id: string): Promise<TransferListingDetail | null> {
|
|
try {
|
|
const res = await fetch(`${API_URL}/transfer/listings/${id}`, {
|
|
next: { revalidate: 300 },
|
|
});
|
|
if (!res.ok) return null;
|
|
return res.json() as Promise<TransferListingDetail>;
|
|
} catch {
|
|
return null;
|
|
}
|
|
}
|