mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2025-05-17 07:22:42 +00:00
Second part of refactor db.Find
(#28194)
Continue of #27798 and move more functions to `db.Find` and `db.Count`.
This commit is contained in:
parent
0abb5633e3
commit
537fa69962
14 changed files with 149 additions and 222 deletions
|
@ -65,16 +65,16 @@ func TestGiteaUploadRepo(t *testing.T) {
|
|||
assert.True(t, repo.HasWiki())
|
||||
assert.EqualValues(t, repo_model.RepositoryReady, repo.Status)
|
||||
|
||||
milestones, _, err := issues_model.GetMilestones(db.DefaultContext, issues_model.GetMilestonesOption{
|
||||
RepoID: repo.ID,
|
||||
State: structs.StateOpen,
|
||||
milestones, err := db.Find[issues_model.Milestone](db.DefaultContext, issues_model.FindMilestoneOptions{
|
||||
RepoID: repo.ID,
|
||||
IsClosed: util.OptionalBoolFalse,
|
||||
})
|
||||
assert.NoError(t, err)
|
||||
assert.Len(t, milestones, 1)
|
||||
|
||||
milestones, _, err = issues_model.GetMilestones(db.DefaultContext, issues_model.GetMilestonesOption{
|
||||
RepoID: repo.ID,
|
||||
State: structs.StateClosed,
|
||||
milestones, err = db.Find[issues_model.Milestone](db.DefaultContext, issues_model.FindMilestoneOptions{
|
||||
RepoID: repo.ID,
|
||||
IsClosed: util.OptionalBoolTrue,
|
||||
})
|
||||
assert.NoError(t, err)
|
||||
assert.Empty(t, milestones)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue