Filer repositories in UI by namespace

This commit is contained in:
René Pfeuffer
2020-09-04 17:13:25 +02:00
parent 12806c7602
commit 2cfdaf1b0b
6 changed files with 81 additions and 32 deletions

View File

@@ -67,11 +67,13 @@ export function fetchRepos(link: string) {
return fetchReposByLink(link);
}
export function fetchReposByPage(link: string, page: number, filter?: string) {
export function fetchReposByPage(link: string, page: number, namespace?: string, filter?: string) {
const namespacePath = namespace ? `${namespace}/` : "";
const linkWithPage = `${link}${namespacePath}?page=${page - 1}`;
if (filter) {
return fetchReposByLink(`${link}?page=${page - 1}&q=${decodeURIComponent(filter)}`);
return fetchReposByLink(`${linkWithPage}}&q=${decodeURIComponent(filter)}`);
}
return fetchReposByLink(`${link}?page=${page - 1}`);
return fetchReposByLink(linkWithPage);
}
function appendSortByLink(url: string) {