Skip to content

Commit

Permalink
fix: show forks by default
Browse files Browse the repository at this point in the history
  • Loading branch information
egor.klimov committed Dec 25, 2023
1 parent 7f3e675 commit 7951153
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,12 @@ class GitHubSearchService(
private val gitHubClient: GitHubClient,
) {
suspend fun searchRepositories(q: String) =
gitHubClient.searchRepositories(q).groupBy { it.owner }
.map { RepositoriesByOwner(it.key, it.value) }
if (q.isNotBlank()) {
gitHubClient.searchRepositories("$q fork:true").groupBy { it.owner }
.map { RepositoriesByOwner(it.key, it.value) }
} else {
emptyList()
}
}

data class RepositoriesByOwner(
Expand Down

0 comments on commit 7951153

Please sign in to comment.