remove unnecessary wrap

This commit is contained in:
Lunny Xiao 2024-05-04 13:33:34 +08:00
parent cf9ef10510
commit f7f36ddbaa
No known key found for this signature in database
GPG Key ID: C3B7C91B632F738A

View File

@ -90,16 +90,10 @@ func LoadIssuesFromBoardList(ctx context.Context, bs project_model.BoardList) (m
return issuesMap, nil
}
// IssueAssignOrRemoveProject changes the project associated with an issue, if newProjectID is 0, the issue is removed from the project
// IssueAssignOrRemoveProject changes the project associated with an issue
// If newProjectID is 0, the issue is removed from the project
func IssueAssignOrRemoveProject(ctx context.Context, issue *Issue, doer *user_model.User, newProjectID, newColumnID int64) error {
return db.WithTx(ctx, func(ctx context.Context) error {
return issueAssignOrRemoveProject(ctx, issue, doer, newProjectID, newColumnID)
})
}
// issueAssignOrRemoveProject adds or updates the project the default column associated with an issue
// If newProjectID is 0, the issue is removed from the project
func issueAssignOrRemoveProject(ctx context.Context, issue *Issue, doer *user_model.User, newProjectID, newColumnID int64) error {
oldProjectID := issue.projectID(ctx)
if err := issue.LoadRepo(ctx); err != nil {
@ -154,4 +148,5 @@ func issueAssignOrRemoveProject(ctx context.Context, issue *Issue, doer *user_mo
ProjectBoardID: newColumnID,
Sorting: maxSorting,
})
})
}