From c7fa9dcaf63eb45021f5d86f69d325121a5a05b8 Mon Sep 17 00:00:00 2001 From: yp05327 <576951401@qq.com> Date: Wed, 10 Apr 2024 23:47:11 +0000 Subject: [PATCH] redirect to project page --- routers/web/org/projects.go | 3 +-- routers/web/repo/projects.go | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/routers/web/org/projects.go b/routers/web/org/projects.go index 5844a9f277299..d439b11cf926f 100644 --- a/routers/web/org/projects.go +++ b/routers/web/org/projects.go @@ -7,7 +7,6 @@ import ( "errors" "fmt" "net/http" - "net/url" "strconv" "strings" @@ -211,7 +210,7 @@ func ChangeProjectStatus(ctx *context.Context) { ctx.NotFoundOrServerError("ChangeProjectStatusByRepoIDAndID", project_model.IsErrProjectNotExist, err) return } - ctx.JSONRedirect(ctx.ContextUser.HomeLink() + "/-/projects?state=" + url.QueryEscape(ctx.Params(":action"))) + ctx.JSONRedirect(fmt.Sprintf("%s/-/projects/%d", ctx.ContextUser.HomeLink(), id)) } // DeleteProject delete a project diff --git a/routers/web/repo/projects.go b/routers/web/repo/projects.go index 6b15f28b8c1e6..9b765e89e877f 100644 --- a/routers/web/repo/projects.go +++ b/routers/web/repo/projects.go @@ -7,7 +7,6 @@ import ( "errors" "fmt" "net/http" - "net/url" "strings" "code.gitea.io/gitea/models/db" @@ -184,7 +183,7 @@ func ChangeProjectStatus(ctx *context.Context) { ctx.NotFoundOrServerError("ChangeProjectStatusByRepoIDAndID", project_model.IsErrProjectNotExist, err) return } - ctx.JSONRedirect(ctx.Repo.RepoLink + "/projects?state=" + url.QueryEscape(ctx.Params(":action"))) + ctx.JSONRedirect(fmt.Sprintf("%s/projects/%d", ctx.Repo.RepoLink, id)) } // DeleteProject delete a project