Merge pull request #1659 from kounoike/pr-api-pr-merged

fix getMergedComment for PR API merged field.
This commit is contained in:
Naoki Takezoe
2017-08-06 03:20:12 +09:00
committed by GitHub

View File

@@ -32,8 +32,11 @@ trait IssuesService {
.list
def getMergedComment(owner: String, repository: String, issueId: Int)(implicit s: Session): Option[(IssueComment, Account)] = {
getCommentsForApi(owner, repository, issueId)
.collectFirst { case (comment, account, _) if comment.action == "merged" => (comment, account) }
IssueComments.filter(_.byIssue(owner, repository, issueId))
.filter(_.action === "merge".bind)
.join(Accounts).on { case t1 ~ t2 => t1.commentedUserName === t2.userName }
.map { case t1 ~ t2 => (t1, t2)}
.firstOption
}
def getComment(owner: String, repository: String, commentId: String)(implicit s: Session): Option[IssueComment] = {