Standalone raw file redirects (#428)

This commit is contained in:
Spencer Woo
2022-02-14 19:33:19 +08:00
committed by GitHub
parent 0fda1c93db
commit 9493ce9f3d
30 changed files with 365 additions and 185 deletions
+2 -2
View File
@@ -40,10 +40,10 @@ export function useProtectedSWRInfinite(path: string = '') {
if (previousPageData && !previousPageData.folder) return null
// First page with no prevPageData
if (pageIndex === 0) return [`/api?path=${path}`, hashedToken]
if (pageIndex === 0) return [`/api/?path=${path}`, hashedToken]
// Add nextPage token to API endpoint
return [`/api?path=${path}&next=${previousPageData.next}`, hashedToken]
return [`/api/?path=${path}&next=${previousPageData.next}`, hashedToken]
}
// Disable auto-revalidate, these options are equivalent to useSWRImmutable