mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2025-06-01 04:12:10 +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:
parent
cbf5dffaf2
commit
bfda0f3864
10 changed files with 102 additions and 29 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue