forked from forgejo/forgejo
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
|
@ -131,18 +131,22 @@ func (issue *Issue) toggleAssignee(sess *xorm.Session, doer *User, assigneeID in
|
|||
return false, nil, fmt.Errorf("loadRepo: %v", err)
|
||||
}
|
||||
|
||||
// Comment
|
||||
comment, err = createComment(sess, &CreateCommentOptions{
|
||||
var opts = &CreateCommentOptions{
|
||||
Type: CommentTypeAssignees,
|
||||
Doer: doer,
|
||||
Repo: issue.Repo,
|
||||
Issue: issue,
|
||||
RemovedAssignee: removed,
|
||||
AssigneeID: assigneeID,
|
||||
})
|
||||
}
|
||||
// Comment
|
||||
comment, err = createCommentWithNoAction(sess, opts)
|
||||
if err != nil {
|
||||
return false, nil, fmt.Errorf("createComment: %v", err)
|
||||
}
|
||||
if err = sendCreateCommentAction(sess, opts, comment); err != nil {
|
||||
return false, nil, err
|
||||
}
|
||||
|
||||
// if pull request is in the middle of creation - don't call webhook
|
||||
if isCreate {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue