Skip to content

Commit 56e461d

Browse files
authored
Merge pull request #2013 from floccusaddon/fix/linkwarden
fix(Linkwarden): Switch to new search endpoint
2 parents bb2fc75 + f0248c0 commit 56e461d

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)