aboutsummaryrefslogtreecommitdiffstats
path: root/routers/web/user
diff options
context:
space:
mode:
author6543 <6543@obermui.de>2024-03-13 09:25:53 +0100
committerGitHub <noreply@github.com>2024-03-13 08:25:53 +0000
commit7fd0a5b276aadcf88dcc012fcd364fe160a58810 (patch)
tree35701a5dc87f3e69ae5f25a681ac0702887b43af /routers/web/user
parent67e9f0d49828f62a942ac6db04153207f88e82ee (diff)
downloadgitea-7fd0a5b276aadcf88dcc012fcd364fe160a58810.tar.gz
gitea-7fd0a5b276aadcf88dcc012fcd364fe160a58810.zip
Refactor to use optional.Option for issue index search option (#29739)
Signed-off-by: 6543 <6543@obermui.de>
Diffstat (limited to 'routers/web/user')
-rw-r--r--routers/web/user/home.go20
1 files changed, 10 insertions, 10 deletions
diff --git a/routers/web/user/home.go b/routers/web/user/home.go
index e731a2a9b7..4ec6f6be3f 100644
--- a/routers/web/user/home.go
+++ b/routers/web/user/home.go
@@ -792,15 +792,15 @@ func getUserIssueStats(ctx *context.Context, ctxUser *user_model.User, filterMod
case issues_model.FilterModeYourRepositories:
openClosedOpts.AllPublic = false
case issues_model.FilterModeAssign:
- openClosedOpts.AssigneeID = &doerID
+ openClosedOpts.AssigneeID = optional.Some(doerID)
case issues_model.FilterModeCreate:
- openClosedOpts.PosterID = &doerID
+ openClosedOpts.PosterID = optional.Some(doerID)
case issues_model.FilterModeMention:
- openClosedOpts.MentionID = &doerID
+ openClosedOpts.MentionID = optional.Some(doerID)
case issues_model.FilterModeReviewRequested:
- openClosedOpts.ReviewRequestedID = &doerID
+ openClosedOpts.ReviewRequestedID = optional.Some(doerID)
case issues_model.FilterModeReviewed:
- openClosedOpts.ReviewedID = &doerID
+ openClosedOpts.ReviewedID = optional.Some(doerID)
}
openClosedOpts.IsClosed = optional.Some(false)
ret.OpenCount, err = issue_indexer.CountIssues(ctx, openClosedOpts)
@@ -818,23 +818,23 @@ func getUserIssueStats(ctx *context.Context, ctxUser *user_model.User, filterMod
if err != nil {
return nil, err
}
- ret.AssignCount, err = issue_indexer.CountIssues(ctx, opts.Copy(func(o *issue_indexer.SearchOptions) { o.AssigneeID = &doerID }))
+ ret.AssignCount, err = issue_indexer.CountIssues(ctx, opts.Copy(func(o *issue_indexer.SearchOptions) { o.AssigneeID = optional.Some(doerID) }))
if err != nil {
return nil, err
}
- ret.CreateCount, err = issue_indexer.CountIssues(ctx, opts.Copy(func(o *issue_indexer.SearchOptions) { o.PosterID = &doerID }))
+ ret.CreateCount, err = issue_indexer.CountIssues(ctx, opts.Copy(func(o *issue_indexer.SearchOptions) { o.PosterID = optional.Some(doerID) }))
if err != nil {
return nil, err
}
- ret.MentionCount, err = issue_indexer.CountIssues(ctx, opts.Copy(func(o *issue_indexer.SearchOptions) { o.MentionID = &doerID }))
+ ret.MentionCount, err = issue_indexer.CountIssues(ctx, opts.Copy(func(o *issue_indexer.SearchOptions) { o.MentionID = optional.Some(doerID) }))
if err != nil {
return nil, err
}
- ret.ReviewRequestedCount, err = issue_indexer.CountIssues(ctx, opts.Copy(func(o *issue_indexer.SearchOptions) { o.ReviewRequestedID = &doerID }))
+ ret.ReviewRequestedCount, err = issue_indexer.CountIssues(ctx, opts.Copy(func(o *issue_indexer.SearchOptions) { o.ReviewRequestedID = optional.Some(doerID) }))
if err != nil {
return nil, err
}
- ret.ReviewedCount, err = issue_indexer.CountIssues(ctx, opts.Copy(func(o *issue_indexer.SearchOptions) { o.ReviewedID = &doerID }))
+ ret.ReviewedCount, err = issue_indexer.CountIssues(ctx, opts.Copy(func(o *issue_indexer.SearchOptions) { o.ReviewedID = optional.Some(doerID) }))
if err != nil {
return nil, err
}