feat: add method to fetch merge request discussions

This commit is contained in:
Karl-Philipp Wulfert
2019-02-25 17:11:32 +01:00
parent 7c9b56f678
commit 4ef2cfb738

View File

@@ -17,6 +17,7 @@ import * as request from 'request-promise-native';
import {
AccessLevel,
Branch,
Discussion,
Group,
Issue,
IssueState,
@@ -367,6 +368,18 @@ export class Api {
return this.makeGitLabAPIRequest(`/projects/${projectId}/merge_requests/${mergeRequestIid}/approvals`);
}
/**
* Get discussions of a merge request
*
* @param projectId ID of the project the merge request belongs to
* @param mergeRequestIid IID of the merge request
*/
public getMergeRequestDiscussions(projectId: number, mergeRequestIid: number): Promise<Discussion> {
return this.makeGitLabAPIRequest(
`projects/${projectId}/merge_requests/${mergeRequestIid}/discussions`,
);
}
/**
* Get merge requests of a group or a project
*