initial commit on Federted servers
release gate / check (push) Failing after 8m35s

This commit is contained in:
Andrew S Erwin
2026-10-19 16:23:55 -05:00
commit b9721ff13f
217 changed files with 31534 additions and 0 deletions
+19
View File
@@ -0,0 +1,19 @@
import type { Bookmark } from '@/components/app-shell'
// The API keeps its array response; follow its cursor until the collection is complete.
export async function fetchBookmarks(query = new URLSearchParams(), signal?: AbortSignal): Promise<Bookmark[]> {
const params = new URLSearchParams(query)
const bookmarks = new Map<string, Bookmark>()
const seen = new Set<string>()
for (;;) {
const response = await fetch(`/api/bookmarks?${params}`, { signal })
if (!response.ok) throw new Error('Could not load bookmarks')
const page: Bookmark[] = await response.json()
for (const bookmark of page) bookmarks.set(bookmark.id, bookmark)
const cursor = response.headers.get('X-Next-Cursor')
if (!cursor) return [...bookmarks.values()]
if (seen.has(cursor)) throw new Error('Invalid bookmark pagination')
seen.add(cursor)
params.set('cursor', cursor)
}
}