Commit 646b9706 authored by Andrew Chin's avatar Andrew Chin
Browse files

gitlab: new set_merge_request_note and set_issue_note function

These can be used to set/modify the body of a note on a merge request
or issue.  Note that this will only work for non-system notes (a system
note can be something like "Andrew pushed 2 new commits").
parent 864aa152
......@@ -1150,6 +1150,22 @@ impl Gitlab {
self.post_with_param(path, &[("body", content.as_ref())])
}
/// Edit a note on an issue.
pub fn set_issue_note<C>(
&self,
project: ProjectId,
issue: IssueInternalId,
note: NoteId,
content: C,
) -> GitlabResult<Note>
where
C: AsRef<str>,
{
let path = format!("projects/{}/issues/{}/notes/{}", project, issue, note);
self.put_with_param(path, &[("body", content.as_ref())])
}
/// Get the merge requests for a project.
pub fn merge_requests<I, K, V>(
&self,
......@@ -1542,6 +1558,24 @@ impl Gitlab {
self.post_with_param(path, &[("body", content)])
}
/// Edit a note on a merge request.
pub fn set_merge_request_note<C>(
&self,
project: ProjectId,
merge_request: MergeRequestInternalId,
note: NoteId,
content: C,
) -> GitlabResult<Note>
where
C: AsRef<str>,
{
let path = format!(
"projects/{}/merge_requests/{}/notes/{}",
project, merge_request, note,
);
self.put_with_param(path, &[("body", content.as_ref())])
}
/// Get issues closed by a merge request.
pub fn get_issues_closed_by_merge_request<I, K, V>(
&self,
......
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