added filter for repos

This commit is contained in:
Florian Scholdei
2019-04-10 17:25:36 +02:00
parent 99e78da67b
commit 3008aaaa4d
3 changed files with 18 additions and 10 deletions

View File

@@ -46,7 +46,12 @@ export function fetchRepos(link: string) {
return fetchReposByLink(link);
}
export function fetchReposByPage(link: string, page: number) {
export function fetchReposByPage(link: string, page: number, filter?: string) {
if (filter) {
return fetchReposByLink(
`${link}?page=${page - 1}&q=${decodeURIComponent(filter)}`
);
}
return fetchReposByLink(`${link}?page=${page - 1}`);
}