Implement archive mode for search component (#46)

This commit is contained in:
Sascha Ißbrücker
2021-02-14 16:56:12 +01:00
parent b7676227c0
commit 6fab248c95
7 changed files with 27 additions and 6 deletions

View File

@@ -11,4 +11,13 @@ export class ApiClient {
.then(response => response.json())
.then(data => data.results)
}
getArchivedBookmarks(query, options = {limit: 100, offset: 0}) {
const encodedQuery = encodeURIComponent(query)
const url = `${this.baseUrl}bookmarks/archived?q=${encodedQuery}&limit=${options.limit}&offset=${options.offset}`
return fetch(url)
.then(response => response.json())
.then(data => data.results)
}
}