mirror of
https://github.com/go-gitea/gitea
synced 2025-07-22 18:28:37 +00:00
[API] ListIssues add filter for milestones (#10148)
* Refactor Issue Filter Func * ListIssues add filter for milestones * as per @lafriks * documentation ...
This commit is contained in:
@@ -190,6 +190,11 @@ func issues(ctx *context.Context, milestoneID int64, isPullOption util.OptionalB
|
||||
}
|
||||
pager := context.NewPagination(total, setting.UI.IssuePagingNum, page, 5)
|
||||
|
||||
var mileIDs []int64
|
||||
if milestoneID > 0 {
|
||||
mileIDs = []int64{milestoneID}
|
||||
}
|
||||
|
||||
var issues []*models.Issue
|
||||
if forceEmpty {
|
||||
issues = []*models.Issue{}
|
||||
@@ -199,16 +204,16 @@ func issues(ctx *context.Context, milestoneID int64, isPullOption util.OptionalB
|
||||
Page: pager.Paginater.Current(),
|
||||
PageSize: setting.UI.IssuePagingNum,
|
||||
},
|
||||
RepoIDs: []int64{repo.ID},
|
||||
AssigneeID: assigneeID,
|
||||
PosterID: posterID,
|
||||
MentionedID: mentionedID,
|
||||
MilestoneID: milestoneID,
|
||||
IsClosed: util.OptionalBoolOf(isShowClosed),
|
||||
IsPull: isPullOption,
|
||||
LabelIDs: labelIDs,
|
||||
SortType: sortType,
|
||||
IssueIDs: issueIDs,
|
||||
RepoIDs: []int64{repo.ID},
|
||||
AssigneeID: assigneeID,
|
||||
PosterID: posterID,
|
||||
MentionedID: mentionedID,
|
||||
MilestoneIDs: mileIDs,
|
||||
IsClosed: util.OptionalBoolOf(isShowClosed),
|
||||
IsPull: isPullOption,
|
||||
LabelIDs: labelIDs,
|
||||
SortType: sortType,
|
||||
IssueIDs: issueIDs,
|
||||
})
|
||||
if err != nil {
|
||||
ctx.ServerError("Issues", err)
|
||||
|
Reference in New Issue
Block a user