This commit is contained in:
Your Name committed 2026-10-08 07:12:58 +07:00
1 parent b7f337fb79
commit bf9599008e
29 files changed
+3828 -1541

No files matched your search

+4 -2
View File
@@ -38,8 +38,9 @@ export type ApiResult<T> =
export async function fetchJson<T>(path: string, init?: RequestInit & { next?: { revalidate?: number } }): Promise<T | null> {
try {
const res = await fetch(`${API_BASE}${path}`, {
cache: 'no-store',
...init,
next: init?.next ?? { revalidate: defaultRevalidate },
next: init?.next ?? { revalidate: 0 },
})
if (!res.ok) {
@@ -57,8 +58,9 @@ export async function fetchJson<T>(path: string, init?: RequestInit & { next?: {
export async function fetchJsonResult<T>(path: string, init?: RequestInit & { next?: { revalidate?: number } }): Promise<ApiResult<T>> {
try {
const res = await fetch(`${API_BASE}${path}`, {
cache: 'no-store',
...init,
next: init?.next ?? { revalidate: defaultRevalidate },
next: init?.next ?? { revalidate: 0 },
})
if (!res.ok) {