This commit is contained in:
Your Name committed 2026-10-03 15:09:45 +07:00
1 parent b8a255821b
commit 46f09ab145
16 files changed
+2269 -186

No files matched your search

+5 -1
View File
@@ -1,4 +1,4 @@
import type { Article, Category, Order, Page, Product, ProductDetailSection, StoreSettings } from '@homaroma/types'
import type { Article, Category, CategorySection, Order, Page, Product, ProductDetailSection, StoreSettings } from '@homaroma/types'
import { API_BASE } from './api'
const isDev = process.env.NODE_ENV === 'development'
@@ -128,6 +128,10 @@ export async function getProductDetailSectionsResult(id: string | number, lang =
return await fetchJsonResult<ProductDetailSection[]>(`/products/${id}/detail-sections?lang=${lang}`, { next: { revalidate: defaultRevalidate } })
}
export async function getCategorySectionsResult(id: string | number, lang = 'all'): Promise<ApiResult<CategorySection[]>> {
return await fetchJsonResult<CategorySection[]>(`/categories/${id}/sections?lang=${lang}`, { next: { revalidate: defaultRevalidate } })
}
export async function getProductReviewsResult(id: string | number): Promise<ApiResult<ProductReview[]>> {
return await fetchJsonResult<ProductReview[]>(`/reviews/product/${id}`, { next: { revalidate: defaultRevalidate } })
}