Commit 39402e08 authored by David "novalis" Turner's avatar David "novalis" Turner Committed by Tim Olshansky

getMergeRequestByIid must use a direct url (#247)

parent 14e4766f
......@@ -1131,15 +1131,8 @@ public class GitlabAPI {
* @throws IOException on gitlab api call error
*/
public GitlabMergeRequest getMergeRequestByIid(Serializable projectId, Integer mergeRequestIid) throws IOException {
Query query = new Query()
.append("iid", mergeRequestIid.toString());
query.mergeWith(new Pagination().withPerPage(Pagination.MAX_ITEMS_PER_PAGE).asQuery());
String tailUrl = GitlabProject.URL + "/" + sanitizeProjectId(projectId) + GitlabMergeRequest.URL + query.toString();
List<GitlabMergeRequest> ls = retrieve().getAll(tailUrl, GitlabMergeRequest[].class);
if (ls.size() == 0) {
throw new FileNotFoundException();
}
return ls.get(0);
String tailUrl = GitlabProject.URL + "/" + projectId + GitlabMergeRequest.URL + "/" + mergeRequestIid;
return retrieve().to(tailUrl, GitlabMergeRequest.class);
}
/**
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment