Skip to content

Commit ef820d9

Browse files
committed
minor cleanup to Client.searchRepositories
1 parent 18dc97e commit ef820d9

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

Git.hub/Client.cs

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -156,15 +156,11 @@ public List<Repository> searchRepositories(string query)
156156
var request = new RestRequest("/legacy/repos/search/{query}");
157157
request.AddUrlSegment("query", query);
158158

159-
var repos = client.Get<APIv2.RepositoryListV2>(request);
160-
if (repos.Data == null || repos.Data.Repositories == null)
161-
{
162-
Console.WriteLine(repos.Content);
159+
var repos = client.Get<APIv2.RepositoryListV2>(request).Data;
160+
if (repos == null || repos.Repositories == null)
163161
throw new Exception(string.Format("Could not search for {0}", query));
164-
}
165162

166-
List<Repository> convertedRepos = repos.Data.Repositories.Select(r => r.ToV3(client)).ToList();
167-
return convertedRepos;
163+
return repos.Repositories.Select(r => r.ToV3(client)).ToList();
168164
}
169165
}
170166
}

0 commit comments

Comments
 (0)