This commit is contained in:
Your Name committed 2026-07-19 07:56:18 -04:00
1 parent b415fb2eb4
commit cfd642dee0
3 files changed
+27 -7

No files matched your search

+5 -1
View File
@@ -1,4 +1,4 @@
import type { Article, Category, Order, Page, Product, ProductDetailSection } from '@homaroma/types'
import type { Article, Category, Order, Page, Product, ProductDetailSection, StoreSettings } from '@homaroma/types'
import { API_BASE } from './api'
const isDev = process.env.NODE_ENV === 'development'
@@ -82,6 +82,10 @@ export async function getCategoriesResult(lang = 'all'): Promise<ApiResult<Categ
return await fetchJsonResult<Category[]>(`/categories?lang=${lang}`, { next: { revalidate: 0 } })
}
export async function getStoreSettingsResult(lang = 'all'): Promise<ApiResult<StoreSettings>> {
return await fetchJsonResult<StoreSettings>(`/settings?lang=${lang}`, { next: { revalidate: defaultRevalidate } })
}
export async function getCmsPage(slug: string, lang = 'all'): Promise<Page | null> {
return await fetchJson<Page>(`/pages/${slug}?lang=${lang}`, { next: { revalidate: defaultRevalidate } })
}