aboutsummaryrefslogtreecommitdiffstats
path: root/routers/api/v1
diff options
context:
space:
mode:
authorLunny Xiao <xiaolunwen@gmail.com>2024-10-10 12:56:49 +0800
committerGitHub <noreply@github.com>2024-10-10 04:56:49 +0000
commitc2217670dd7514e17fc9c1f17d7e459b842ea798 (patch)
tree01042a8c4ff3d5352cb028b70b78eddf4f0d7814 /routers/api/v1
parentdd83cfcacc989d0e7cbd21ec5eba029fdfcb72dd (diff)
downloadgitea-c2217670dd7514e17fc9c1f17d7e459b842ea798.tar.gz
gitea-c2217670dd7514e17fc9c1f17d7e459b842ea798.zip
Move admin routers from /admin to /-/admin (#32189)
Resolve #32181 --------- Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
Diffstat (limited to 'routers/api/v1')
-rw-r--r--routers/api/v1/admin/hooks.go4
-rw-r--r--routers/api/v1/utils/hook.go4
2 files changed, 4 insertions, 4 deletions
diff --git a/routers/api/v1/admin/hooks.go b/routers/api/v1/admin/hooks.go
index fa60836b7e..db481fbf59 100644
--- a/routers/api/v1/admin/hooks.go
+++ b/routers/api/v1/admin/hooks.go
@@ -45,7 +45,7 @@ func ListHooks(ctx *context.APIContext) {
}
hooks := make([]*api.Hook, len(sysHooks))
for i, hook := range sysHooks {
- h, err := webhook_service.ToHook(setting.AppURL+"/admin", hook)
+ h, err := webhook_service.ToHook(setting.AppURL+"/-/admin", hook)
if err != nil {
ctx.Error(http.StatusInternalServerError, "convert.ToHook", err)
return
@@ -83,7 +83,7 @@ func GetHook(ctx *context.APIContext) {
}
return
}
- h, err := webhook_service.ToHook("/admin/", hook)
+ h, err := webhook_service.ToHook("/-/admin/", hook)
if err != nil {
ctx.Error(http.StatusInternalServerError, "convert.ToHook", err)
return
diff --git a/routers/api/v1/utils/hook.go b/routers/api/v1/utils/hook.go
index f1abd49a7d..4328878e19 100644
--- a/routers/api/v1/utils/hook.go
+++ b/routers/api/v1/utils/hook.go
@@ -100,7 +100,7 @@ func checkCreateHookOption(ctx *context.APIContext, form *api.CreateHookOption)
func AddSystemHook(ctx *context.APIContext, form *api.CreateHookOption) {
hook, ok := addHook(ctx, form, 0, 0)
if ok {
- h, err := webhook_service.ToHook(setting.AppSubURL+"/admin", hook)
+ h, err := webhook_service.ToHook(setting.AppSubURL+"/-/admin", hook)
if err != nil {
ctx.Error(http.StatusInternalServerError, "convert.ToHook", err)
return
@@ -268,7 +268,7 @@ func EditSystemHook(ctx *context.APIContext, form *api.EditHookOption, hookID in
ctx.Error(http.StatusInternalServerError, "GetSystemOrDefaultWebhook", err)
return
}
- h, err := webhook_service.ToHook(setting.AppURL+"/admin", updated)
+ h, err := webhook_service.ToHook(setting.AppURL+"/-/admin", updated)
if err != nil {
ctx.Error(http.StatusInternalServerError, "convert.ToHook", err)
return