Skip to content

Commit

Permalink
refactor: Updating the MergeRequest API's pipeline function header
Browse files Browse the repository at this point in the history
The function requires the mergerequestId but was exposing this parameter as optional.

BREAKING CHANGE: MergeRequest Pipelines require the mergeRequestId
  • Loading branch information
jdalrymple committed May 25, 2019
1 parent e4ba731 commit 46a541b
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/services/MergeRequests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -182,11 +182,10 @@ class MergeRequests extends BaseService {
return RequestHelper.get(this, `projects/${pId}/merge_requests/${mIId}/participants`, options);
}

pipelines(projectId: ProjectId, { mergerequestId }: { mergerequestId?: string } = {}) {
const pId = encodeURIComponent(projectId);
const mergeRequest = mergerequestId ? `merge_requests/${encodeURIComponent(mergerequestId)}` : '';
pipelines(projectId: ProjectId, mergerequestIId: MergeRequestId, options?: Sudo) {
const [pId, mIId] = [projectId, mergerequestIId].map(encodeURIComponent);

return RequestHelper.get(this, `projects/${pId}/${mergeRequest}/pipelines`);
return RequestHelper.get(this, `projects/${pId}/merge_requests/${mIId}/pipelines`, options);
}

remove(projectId: ProjectId, mergerequestIId: MergeRequestId, options?: Sudo) {
Expand Down

0 comments on commit 46a541b

Please sign in to comment.