feat: render CMS content fields and footer settings
This commit is contained in:
@@ -1,5 +1,11 @@
|
||||
import { fetchAPI } from "./api-client";
|
||||
import type { ContactPageDetail, HomePageDetail, WagtailListResponse } from "@/types/wagtail";
|
||||
import type { ColumnPageDetail, ContactPageDetail, HomePageDetail, WagtailListResponse } from "@/types/wagtail";
|
||||
|
||||
export async function getColumnPage(type: string, slug: string): Promise<ColumnPageDetail | null> {
|
||||
const query = new URLSearchParams({ type, slug, fields: "intro", limit: "1" });
|
||||
const res = await fetchAPI<WagtailListResponse<ColumnPageDetail>>(`/api/v2/pages/?${query}`);
|
||||
return res.items[0] ?? null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取首页内容(取页面树中第一条 home.HomePage)。
|
||||
|
||||
Reference in New Issue
Block a user