From cb68e01e22fb20cb0e23090654a4e7285fb8d933 Mon Sep 17 00:00:00 2001 From: Earl Warren <109468362+earl-warren@users.noreply.github.com> Date: Mon, 2 Oct 2023 04:30:10 +0200 Subject: 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 --- models/issues/issue_update.go | 11 ----------- 1 file changed, 11 deletions(-) (limited to 'models') 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) -- cgit v1.2.3