x
This commit is contained in:
1 parent
b7f337fb79
commit
bf9599008e
29 files changed
+3828
-1541
No files matched your search
@@ -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) {
|
||||
|
||||
Reference in new issue
Block a user