mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2025-05-31 11:52:10 +00:00
Add state param to milestone listing API (#7131)
* Support state params * update tests * fix tests * add state=all support * update tests * update swagger * update swagger
This commit is contained in:
parent
59e6a7b97f
commit
de6539fc8c
8 changed files with 76 additions and 15 deletions
|
@ -24,6 +24,7 @@ import (
|
|||
"code.gitea.io/gitea/modules/markup/markdown"
|
||||
"code.gitea.io/gitea/modules/notification"
|
||||
"code.gitea.io/gitea/modules/setting"
|
||||
api "code.gitea.io/gitea/modules/structs"
|
||||
"code.gitea.io/gitea/modules/util"
|
||||
|
||||
"github.com/Unknwon/com"
|
||||
|
@ -305,7 +306,7 @@ func Issues(ctx *context.Context) {
|
|||
|
||||
var err error
|
||||
// Get milestones.
|
||||
ctx.Data["Milestones"], err = models.GetMilestonesByRepoID(ctx.Repo.Repository.ID)
|
||||
ctx.Data["Milestones"], err = models.GetMilestonesByRepoID(ctx.Repo.Repository.ID, api.StateType(ctx.Query("state")))
|
||||
if err != nil {
|
||||
ctx.ServerError("GetAllRepoMilestones", err)
|
||||
return
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue