mirror of
https://github.com/go-gitea/gitea
synced 2025-07-15 23:17:19 +00:00
Extract createComment (#9125)
* Extract createComment * fix lint * fix lint
This commit is contained in:
committed by
techknowlogick
parent
7c6f2e27be
commit
2011a5b818
@@ -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()
|
||||
}
|
||||
|
Reference in New Issue
Block a user