diff options
author | 6543 <6543@obermui.de> | 2020-07-28 13:30:40 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-07-28 12:30:40 +0100 |
commit | 8bdc9795d8a5aa51bc1295dd1cf57006a5873343 (patch) | |
tree | 81ebd17da66318ca7909284021319be10a552e5c /modules/migrations | |
parent | 78cbd0ca72619a25849edc3460ec0c492b838a59 (diff) | |
download | gitea-8bdc9795d8a5aa51bc1295dd1cf57006a5873343.tar.gz gitea-8bdc9795d8a5aa51bc1295dd1cf57006a5873343.zip |
Add name filter to API for GetMilestoneList (#12336)
Adds a name filter to the API for GetMilestoneList
Includes a small refactor: merge GetMilestones and GetMilestonesByRepoID
Close #12260
Needed for https://gitea.com/gitea/go-sdk/issues/383 and https://gitea.com/gitea/tea/pulls/149
Diffstat (limited to 'modules/migrations')
-rw-r--r-- | modules/migrations/gitea_test.go | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/modules/migrations/gitea_test.go b/modules/migrations/gitea_test.go index 3f03cbab31..c0d2dcd180 100644 --- a/modules/migrations/gitea_test.go +++ b/modules/migrations/gitea_test.go @@ -51,11 +51,17 @@ func TestGiteaUploadRepo(t *testing.T) { repo := models.AssertExistsAndLoadBean(t, &models.Repository{OwnerID: user.ID, Name: repoName}).(*models.Repository) assert.True(t, repo.HasWiki()) - milestones, err := models.GetMilestones(repo.ID, 0, false, "") + milestones, err := models.GetMilestones(models.GetMilestonesOption{ + RepoID: repo.ID, + State: structs.StateOpen, + }) assert.NoError(t, err) assert.EqualValues(t, 1, len(milestones)) - milestones, err = models.GetMilestones(repo.ID, 0, true, "") + milestones, err = models.GetMilestones(models.GetMilestonesOption{ + RepoID: repo.ID, + State: structs.StateClosed, + }) assert.NoError(t, err) assert.EqualValues(t, 0, len(milestones)) |