Skip to content

Commit

Permalink
Merge pull request #20 from JetBrains-Research/forks
Browse files Browse the repository at this point in the history
fix: show forks by default
  • Loading branch information
NikolaiSviridov authored Dec 25, 2023
2 parents 39c60e4 + 7951153 commit 6ffa115
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 6ffa115

Please sign in to comment.