1
0
Fork 0
forked from forgejo/forgejo

Use more IssueList instead of []*Issue (#26369)

This commit is contained in:
Lunny Xiao 2023-08-08 03:26:40 +08:00 committed by GitHub
parent ab0eb1c47b
commit f5dbac9d36
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 7 additions and 8 deletions

View file

@ -854,8 +854,8 @@ func (issue *Issue) MovePin(ctx context.Context, newPosition int) error {
}
// GetPinnedIssues returns the pinned Issues for the given Repo and type
func GetPinnedIssues(ctx context.Context, repoID int64, isPull bool) ([]*Issue, error) {
issues := make([]*Issue, 0)
func GetPinnedIssues(ctx context.Context, repoID int64, isPull bool) (IssueList, error) {
issues := make(IssueList, 0)
err := db.GetEngine(ctx).
Table("issue").
@ -868,7 +868,7 @@ func GetPinnedIssues(ctx context.Context, repoID int64, isPull bool) ([]*Issue,
return nil, err
}
err = IssueList(issues).LoadAttributes(ctx)
err = issues.LoadAttributes(ctx)
if err != nil {
return nil, err
}