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>
This commit is contained in:
Earl Warren 2023-10-02 04:30:10 +02:00 committed by GitHub
parent c9cc57f130
commit cb68e01e22
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 18 additions and 47 deletions

View file

@ -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)