Skip to content

Use /orgs/:orgname/repos API call to retrieve all the repositories fr… #9

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ public class GogsServerAPIClient implements GogsApi {

private static final Logger LOGGER = Logger.getLogger(GogsServerAPIClient.class.getName());
private static final String API_BASE_PATH = "/api/v1";
private static final String API_REPOSITORIES_PATH = API_BASE_PATH + "/repos/search?q=_&uid=%d";
private static final String API_REPOSITORIES_PATH = API_BASE_PATH + "/orgs/%s/repos";
private static final String API_REPOSITORY_PATH = API_BASE_PATH + "/repos/%s/%s";
private static final String API_BRANCHES_PATH = API_BASE_PATH + "/repos/%s/%s/branches";
private static final String API_BRANCH_PATH = API_BASE_PATH + "/repos/%s/%s/branches/%s";
Expand Down Expand Up @@ -241,14 +241,14 @@ public GogsOrganization getOrganization() {
/** {@inheritDoc} */
@Override
public List<GogsServerRepository> getRepositories() {
GogsRepositoryOwner user = getUser();
String url = String.format(API_REPOSITORIES_PATH, user.getId());
// GogsRepositoryOwner user = getUser();
String url = String.format(API_REPOSITORIES_PATH, getOwner());

try {
String response = getRequest(url);
GogsServerRepositories wrappedRepos = parse(response, GogsServerRepositories.class);

return wrappedRepos.getData();
return parseCollection(response, GogsServerRepository.class);

} catch (IOException e) {
LOGGER.log(Level.SEVERE, "invalid repositories response", e);
}
Expand Down