aboutsummaryrefslogtreecommitdiffstats
path: root/routers/web/org/projects.go
diff options
context:
space:
mode:
author6543 <6543@obermui.de>2024-03-02 16:42:31 +0100
committerGitHub <noreply@github.com>2024-03-02 16:42:31 +0100
commita3f05d0d98408bb47333b19f505b21afcefa9e7c (patch)
treee4a1f8c48b45668ccdcb84fabc7fa77b47990bfa /routers/web/org/projects.go
parent3f081d4b54261c1b4ee4f1df40c610fdd9581ef2 (diff)
downloadgitea-a3f05d0d98408bb47333b19f505b21afcefa9e7c.tar.gz
gitea-a3f05d0d98408bb47333b19f505b21afcefa9e7c.zip
remove util.OptionalBool and related functions (#29513)
and migrate affected code _last refactoring bits to replace **util.OptionalBool** with **optional.Option[bool]**_
Diffstat (limited to 'routers/web/org/projects.go')
-rw-r--r--routers/web/org/projects.go8
1 files changed, 4 insertions, 4 deletions
diff --git a/routers/web/org/projects.go b/routers/web/org/projects.go
index 82cd91997a..ad8bb90d9e 100644
--- a/routers/web/org/projects.go
+++ b/routers/web/org/projects.go
@@ -18,9 +18,9 @@ import (
"code.gitea.io/gitea/models/unit"
"code.gitea.io/gitea/modules/base"
"code.gitea.io/gitea/modules/json"
+ "code.gitea.io/gitea/modules/optional"
"code.gitea.io/gitea/modules/setting"
"code.gitea.io/gitea/modules/templates"
- "code.gitea.io/gitea/modules/util"
"code.gitea.io/gitea/modules/web"
shared_user "code.gitea.io/gitea/routers/web/shared/user"
"code.gitea.io/gitea/services/context"
@@ -67,7 +67,7 @@ func Projects(ctx *context.Context) {
PageSize: setting.UI.IssuePagingNum,
},
OwnerID: ctx.ContextUser.ID,
- IsClosed: util.OptionalBoolOf(isShowClosed),
+ IsClosed: optional.Some(isShowClosed),
OrderBy: project_model.GetSearchOrderByBySortType(sortType),
Type: projectType,
Title: keyword,
@@ -79,7 +79,7 @@ func Projects(ctx *context.Context) {
opTotal, err := db.Count[project_model.Project](ctx, project_model.SearchOptions{
OwnerID: ctx.ContextUser.ID,
- IsClosed: util.OptionalBoolOf(!isShowClosed),
+ IsClosed: optional.Some(!isShowClosed),
Type: projectType,
})
if err != nil {
@@ -388,7 +388,7 @@ func ViewProject(ctx *context.Context) {
if len(referencedIDs) > 0 {
if linkedPrs, err := issues_model.Issues(ctx, &issues_model.IssuesOptions{
IssueIDs: referencedIDs,
- IsPull: util.OptionalBoolTrue,
+ IsPull: optional.Some(true),
}); err == nil {
linkedPrsMap[issue.ID] = linkedPrs
}