Fix search by issue type (#1914)

* Fix search by issue type
This commit is contained in:
Ethan Koenig 2017-06-14 23:09:03 -04:00 committed by Kim "BKC" Carlbäcker
parent bf48c8ebdd
commit 8fcda0442e
5 changed files with 121 additions and 59 deletions

View file

@ -120,6 +120,15 @@ func Issues(ctx *context.Context) {
forceEmpty bool
)
if ctx.IsSigned {
switch viewType {
case "created_by":
posterID = ctx.User.ID
case "mentioned":
mentionedID = ctx.User.ID
}
}
repo := ctx.Repo.Repository
selectLabels := ctx.Query("labels")
milestoneID := ctx.QueryInt64("milestone")
@ -150,11 +159,12 @@ func Issues(ctx *context.Context) {
MilestoneID: milestoneID,
AssigneeID: assigneeID,
MentionedID: mentionedID,
PosterID: posterID,
IsPull: isPullList,
IssueIDs: issueIDs,
})
if err != nil {
ctx.Error(500, "GetSearchIssueStats")
ctx.Handle(500, "GetIssueStats", err)
return
}
}