forked from UKSOURCE/hailearning.edu.vn
fix: blog dynamic build
This commit is contained in:
@@ -15,10 +15,10 @@ export const aboutApi = {
|
||||
try {
|
||||
const apiUrl = getApiUrl();
|
||||
const response = await fetch(`${apiUrl}/api/about`, {
|
||||
// Không cache - luôn fetch dữ liệu mới nhất
|
||||
cache: 'no-store',
|
||||
headers: {
|
||||
'Cache-Control': 'no-cache',
|
||||
'Pragma': 'no-cache'
|
||||
'Content-Type': 'application/json',
|
||||
}
|
||||
});
|
||||
if (!response.ok) {
|
||||
|
||||
@@ -53,9 +53,7 @@ export const fetchBlogList = async (
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
},
|
||||
// Next.js: cache và revalidate (disabled)
|
||||
// next: { revalidate: 60 }, // Revalidate mỗi 60 giây
|
||||
// no-cache
|
||||
// Không cache - luôn fetch dữ liệu mới nhất
|
||||
cache: 'no-store',
|
||||
});
|
||||
|
||||
@@ -91,8 +89,7 @@ export const fetchBlogDetail = async (
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
},
|
||||
// No cache for blog detail (disabled caching)
|
||||
// no-cache
|
||||
// Không cache - luôn fetch dữ liệu mới nhất
|
||||
cache: 'no-store',
|
||||
});
|
||||
|
||||
@@ -131,8 +128,7 @@ export const fetchFeaturedBlogs = async (
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
},
|
||||
// next: { revalidate: 60 },
|
||||
// no-cache
|
||||
// Không cache - luôn fetch dữ liệu mới nhất
|
||||
cache: 'no-store',
|
||||
});
|
||||
|
||||
@@ -168,8 +164,7 @@ export const fetchRecentBlogs = async (
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
},
|
||||
// next: { revalidate: 60 },
|
||||
// no-cache
|
||||
// Không cache - luôn fetch dữ liệu mới nhất
|
||||
cache: 'no-store',
|
||||
});
|
||||
|
||||
@@ -202,8 +197,7 @@ export const fetchCategories = async (): Promise<CategoryListResponse> => {
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
},
|
||||
// next: { revalidate: 300 }, // Categories ít thay đổi, cache lâu hơn
|
||||
// no-cache
|
||||
// Không cache - luôn fetch dữ liệu mới nhất
|
||||
cache: 'no-store',
|
||||
});
|
||||
|
||||
@@ -239,8 +233,7 @@ export const fetchCategoryDetail = async (
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
},
|
||||
// next: { revalidate: 300 },
|
||||
// no-cache
|
||||
// Không cache - luôn fetch dữ liệu mới nhất
|
||||
cache: 'no-store',
|
||||
});
|
||||
|
||||
@@ -276,8 +269,7 @@ export const fetchTags = async (): Promise<TagListResponse> => {
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
},
|
||||
// next: { revalidate: 300 },
|
||||
// no-cache
|
||||
// Không cache - luôn fetch dữ liệu mới nhất
|
||||
cache: 'no-store',
|
||||
});
|
||||
|
||||
@@ -313,8 +305,7 @@ export const fetchPopularTags = async (
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
},
|
||||
// next: { revalidate: 300 },
|
||||
// no-cache
|
||||
// Không cache - luôn fetch dữ liệu mới nhất
|
||||
cache: 'no-store',
|
||||
});
|
||||
|
||||
@@ -350,8 +341,7 @@ export const fetchTagDetail = async (
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
},
|
||||
// next: { revalidate: 300 },
|
||||
// no-cache
|
||||
// Không cache - luôn fetch dữ liệu mới nhất
|
||||
cache: 'no-store',
|
||||
});
|
||||
|
||||
|
||||
@@ -138,6 +138,8 @@ export const fetchServicePageData = async (): Promise<ServicePageData> => {
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
},
|
||||
// Không cache - luôn fetch dữ liệu mới nhất
|
||||
cache: "no-store",
|
||||
});
|
||||
|
||||
console.log("Services API response status:", response.status);
|
||||
@@ -179,6 +181,8 @@ export const fetchServiceBySlug = async (slug: string): Promise<any> => {
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
},
|
||||
// Không cache - luôn fetch dữ liệu mới nhất
|
||||
cache: "no-store",
|
||||
});
|
||||
|
||||
console.log("Response status:", response.status);
|
||||
|
||||
Reference in New Issue
Block a user