This commit is contained in:
2026-03-13 13:54:45 +07:00
parent a8e30f32a0
commit 25111ff10e
120 changed files with 4213 additions and 4859 deletions

23
src/lib/api/page.ts Normal file
View File

@@ -0,0 +1,23 @@
import { apiFetch } from './client';
export type PageType =
| 'category'
| 'product-search'
| 'product-detail'
| 'product-hot'
| 'article-home'
| 'article-category'
| 'article-detail'
| '404';
interface ResolvePageTypeResponse {
pageType: PageType;
}
export async function getResolvedPageType(slug: string) {
const result = await apiFetch<ResolvePageTypeResponse>(
`/page-type?slug=${encodeURIComponent(slug)}`,
);
return result.pageType;
}