diff options
author | Earl Warren <109468362+earl-warren@users.noreply.github.com> | 2023-10-02 04:30:10 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-10-02 04:30:10 +0200 |
commit | cb68e01e22fb20cb0e23090654a4e7285fb8d933 (patch) | |
tree | d2bfc08dbab9fbdb19796f88c8d9599089233b50 /models | |
parent | [skip ci] Updated licenses and gitignores (diff) | |
download | forgejo-cb68e01e22fb20cb0e23090654a4e7285fb8d933.tar.xz forgejo-cb68e01e22fb20cb0e23090654a4e7285fb8d933.zip |
simplify issue deletion query (#27312)
- There's no need for `In` to be used, as it's a single parameter that's
being passed.
Refs: https://codeberg.org/forgejo/forgejo/pulls/1521
(cherry picked from commit 4a4955f43ae7fc50cfe3b48409a0a10c82625a19)
Co-authored-by: Gusted <postmaster@gusted.xyz>
Diffstat (limited to 'models')
-rw-r--r-- | models/issues/issue_update.go | 11 |
1 files changed, 0 insertions, 11 deletions
diff --git a/models/issues/issue_update.go b/models/issues/issue_update.go index a8097fa3b4..c01cb859e2 100644 --- a/models/issues/issue_update.go +++ b/models/issues/issue_update.go @@ -510,17 +510,6 @@ func UpdateIssueDeadline(ctx context.Context, issue *Issue, deadlineUnix timeuti return committer.Commit() } -// DeleteInIssue delete records in beans with external key issue_id = ? -func DeleteInIssue(ctx context.Context, issueID int64, beans ...any) error { - e := db.GetEngine(ctx) - for _, bean := range beans { - if _, err := e.In("issue_id", issueID).Delete(bean); err != nil { - return err - } - } - return nil -} - // FindAndUpdateIssueMentions finds users mentioned in the given content string, and saves them in the database. func FindAndUpdateIssueMentions(ctx context.Context, issue *Issue, doer *user_model.User, content string) (mentions []*user_model.User, err error) { rawMentions := references.FindAllMentionsMarkdown(content) |