Skip to content

Commit f0248c0

Browse files
committed
fix(Linkwarden): Switch to new search endpoint
instead of the links endpoint fixes #2011 Signed-off-by: Marcel Klehr <[email protected]>
1 parent bb2fc75 commit f0248c0

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/lib/adapters/Linkwarden.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -191,11 +191,11 @@ export default class LinkwardenAdapter implements Adapter, IResource<typeof Item
191191

192192
async getBookmarksTree(loadAll?: boolean): Promise<Folder<typeof ItemLocation.SERVER>> {
193193
const links = []
194-
let response
194+
let data
195195
do {
196-
({ response } = await this.sendRequest('GET', `/api/v1/links?cursor=${links.length ? links[links.length - 1].id : ''}`))
197-
links.push(...response)
198-
} while (response.length !== 0)
196+
({ data } = await this.sendRequest('GET', `/api/v1/search?searchQueryString=&cursor=${data?.nextCursor || ''}`))
197+
links.push(...data.links)
198+
} while (data.links.length !== 0 && data.nextCursor !== null)
199199

200200
const { response: collections } = await this.sendRequest('GET', `/api/v1/collections`)
201201

0 commit comments

Comments
 (0)