diff options
author | Lunny Xiao <xiaolunwen@gmail.com> | 2022-03-29 22:57:33 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-03-29 16:57:33 +0200 |
commit | 74731c3a5aea71c81e4ca75bde96154f3adf3cfa (patch) | |
tree | 64b01935ab9912de71318eac447721e41b200135 /models/issue_assignees.go | |
parent | bd97736b9c7a16023bc9abf17be6157284f655b1 (diff) | |
download | gitea-74731c3a5aea71c81e4ca75bde96154f3adf3cfa.tar.gz gitea-74731c3a5aea71c81e4ca75bde96154f3adf3cfa.zip |
Move some issue methods as functions (#19255)
* Move some issue methods as functions
* Fix bug
Diffstat (limited to 'models/issue_assignees.go')
-rw-r--r-- | models/issue_assignees.go | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/models/issue_assignees.go b/models/issue_assignees.go index b3511f8b59..a91793f2f1 100644 --- a/models/issue_assignees.go +++ b/models/issue_assignees.go @@ -92,15 +92,15 @@ func clearAssigneeByUserID(sess db.Engine, userID int64) (err error) { return } -// ToggleAssignee changes a user between assigned and not assigned for this issue, and make issue comment for it. -func (issue *Issue) ToggleAssignee(doer *user_model.User, assigneeID int64) (removed bool, comment *Comment, err error) { +// ToggleIssueAssignee changes a user between assigned and not assigned for this issue, and make issue comment for it. +func ToggleIssueAssignee(issue *Issue, doer *user_model.User, assigneeID int64) (removed bool, comment *Comment, err error) { ctx, committer, err := db.TxContext() if err != nil { return false, nil, err } defer committer.Close() - removed, comment, err = issue.toggleAssignee(ctx, doer, assigneeID, false) + removed, comment, err = toggleIssueAssignee(ctx, issue, doer, assigneeID, false) if err != nil { return false, nil, err } @@ -112,7 +112,7 @@ func (issue *Issue) ToggleAssignee(doer *user_model.User, assigneeID int64) (rem return removed, comment, nil } -func (issue *Issue) toggleAssignee(ctx context.Context, doer *user_model.User, assigneeID int64, isCreate bool) (removed bool, comment *Comment, err error) { +func toggleIssueAssignee(ctx context.Context, issue *Issue, doer *user_model.User, assigneeID int64, isCreate bool) (removed bool, comment *Comment, err error) { sess := db.GetEngine(ctx) removed, err = toggleUserAssignee(sess, issue, assigneeID) if err != nil { |