Extract createComment (#9125)

* Extract createComment

* fix lint

* fix lint
This commit is contained in:
Lunny Xiao 2019-12-01 10:44:39 +08:00 committed by techknowlogick
parent 7c6f2e27be
commit 2011a5b818
9 changed files with 130 additions and 53 deletions

View file

@ -45,16 +45,21 @@ func updateIssueLock(opts *IssueLockOptions, lock bool) error {
return err
}
_, err := createComment(sess, &CreateCommentOptions{
var opt = &CreateCommentOptions{
Doer: opts.Doer,
Issue: opts.Issue,
Repo: opts.Issue.Repo,
Type: commentType,
Content: opts.Reason,
})
}
comment, err := createCommentWithNoAction(sess, opt)
if err != nil {
return err
}
if err = sendCreateCommentAction(sess, opt, comment); err != nil {
return err
}
return sess.Commit()
}