mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2025-05-15 14:32:42 +00:00
[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:
parent
de5bb2a224
commit
4a4955f43a
2 changed files with 18 additions and 47 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue