[GITEA] Simplify issue deletion query

- There's no need for `In` to be used, as it's a single parameter that's
being passed.
This commit is contained in:
Gusted 2023-09-26 21:01:41 +02:00
parent de5bb2a224
commit 4a4955f43a
No known key found for this signature in database
GPG key ID: FD821B732837125F
2 changed files with 18 additions and 47 deletions

View file

@ -532,17 +532,6 @@ func UpdateIssueDeadline(issue *Issue, deadlineUnix timeutil.TimeStamp, doer *us
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)