fixed no images problem and no cache in fetchCourses

This commit is contained in:
2024-11-05 23:06:48 +08:00
parent a00cd857f1
commit b6c5b15900
2 changed files with 41 additions and 19 deletions

View File

@@ -92,7 +92,7 @@ export async function fetchCourses() {
console.log('Fetching from URL:', url);
try {
const response = await fetch(url, { headers });
const response = await fetch(url, { headers, cache: 'no-store', next: { revalidate: 0 } });
const result = await response.json();
@@ -124,7 +124,10 @@ export async function fetchCourse(id: string) {
try {
const response = await fetch(url, { headers });
const response = await fetch(url, {
headers, cache: 'no-store',
next: { revalidate: 0 }
});
var result: CoursesProps = await response.json();