aboutsummaryrefslogtreecommitdiffstats
path: root/routers/api
diff options
context:
space:
mode:
Diffstat (limited to 'routers/api')
-rw-r--r--routers/api/v1/repo/milestone.go13
1 files changed, 11 insertions, 2 deletions
diff --git a/routers/api/v1/repo/milestone.go b/routers/api/v1/repo/milestone.go
index adb9deaee4..f6f6b29465 100644
--- a/routers/api/v1/repo/milestone.go
+++ b/routers/api/v1/repo/milestone.go
@@ -39,6 +39,10 @@ func ListMilestones(ctx *context.APIContext) {
// in: query
// description: Milestone state, Recognised values are open, closed and all. Defaults to "open"
// type: string
+ // - name: name
+ // in: query
+ // description: filter by milestone name
+ // type: string
// - name: page
// in: query
// description: page number of results to return (1-based)
@@ -51,9 +55,14 @@ func ListMilestones(ctx *context.APIContext) {
// "200":
// "$ref": "#/responses/MilestoneList"
- milestones, err := models.GetMilestonesByRepoID(ctx.Repo.Repository.ID, api.StateType(ctx.Query("state")), utils.GetListOptions(ctx))
+ milestones, err := models.GetMilestones(models.GetMilestonesOption{
+ ListOptions: utils.GetListOptions(ctx),
+ RepoID: ctx.Repo.Repository.ID,
+ State: api.StateType(ctx.Query("state")),
+ Name: ctx.Query("name"),
+ })
if err != nil {
- ctx.Error(http.StatusInternalServerError, "GetMilestonesByRepoID", err)
+ ctx.Error(http.StatusInternalServerError, "GetMilestones", err)
return
}