updateCommitComment method

Future<CommitComment> updateCommitComment(
  1. RepositorySlug slug, {
  2. required int id,
  3. required String body,
})

Update a commit comment

  • id: id of the comment to update.
  • body: new body of the comment.

Returns the updated commit comment.

https://developer.github.com/v3/repos/comments/#update-a-commit-comment

Implementation

Future<CommitComment> updateCommitComment(RepositorySlug slug,
    {required int id, required String body}) async {
  ArgumentError.checkNotNull(slug);
  ArgumentError.checkNotNull(id);
  ArgumentError.checkNotNull(body);
  return github.postJSON<Map<String, dynamic>, CommitComment>(
    '/repos/${slug.fullName}/comments/$id',
    body: GitHubJson.encode(createNonNullMap({'body': body})),
    statusCode: StatusCodes.OK,
    convert: (i) => CommitComment.fromJson(i),
  );
}