fix: swr 2.0 fetcher key args changes
This commit is contained in:
parent
370a9e622b
commit
21134b36e0
2 changed files with 4 additions and 4 deletions
|
@ -188,10 +188,10 @@ export async function* traverseFolder(path: string): AsyncGenerator<TraverseItem
|
|||
return {
|
||||
i,
|
||||
path,
|
||||
data: await fetcher(
|
||||
data: await fetcher([
|
||||
next ? `/api/?path=${path}&next=${next}` : `/api?path=${path}`,
|
||||
hashedToken ?? undefined
|
||||
).catch(error => ({ i, path, error })),
|
||||
hashedToken ?? undefined,
|
||||
]).catch(error => ({ i, path, error })),
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -6,7 +6,7 @@ import type { OdAPIResponse } from '../types'
|
|||
import { getStoredToken } from './protectedRouteHandler'
|
||||
|
||||
// Common axios fetch function for use with useSWR
|
||||
export async function fetcher(url: string, token?: string): Promise<any> {
|
||||
export async function fetcher([url, token]: [url: string, token?: string]): Promise<any> {
|
||||
try {
|
||||
return (
|
||||
await (token
|
||||
|
|
Loading…
Reference in a new issue