From 4ef2cfb7382973487b7be03b714270ed40d0c7ae Mon Sep 17 00:00:00 2001 From: Karl-Philipp Wulfert Date: Mon, 25 Feb 2019 17:11:32 +0100 Subject: [PATCH] feat: add method to fetch merge request discussions --- src/api.ts | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/api.ts b/src/api.ts index 91dbffd1..2757d087 100644 --- a/src/api.ts +++ b/src/api.ts @@ -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 { + return this.makeGitLabAPIRequest( + `projects/${projectId}/merge_requests/${mergeRequestIid}/discussions`, + ); + } + /** * Get merge requests of a group or a project *