mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2025-05-31 06:04:35 -04:00
Extract createComment (#9125)
* Extract createComment * fix lint * fix lint
This commit is contained in:
parent
7c6f2e27be
commit
2011a5b818
9 changed files with 130 additions and 53 deletions
|
@ -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()
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue