webhook: add admin-hooks tests
This commit is contained in:
parent
e0b5f2d59b
commit
9a94019db4
5 changed files with 40 additions and 20 deletions
|
@ -8,7 +8,6 @@ import (
|
|||
"net/http"
|
||||
|
||||
"code.gitea.io/gitea/models/webhook"
|
||||
"code.gitea.io/gitea/modules/optional"
|
||||
"code.gitea.io/gitea/modules/setting"
|
||||
api "code.gitea.io/gitea/modules/structs"
|
||||
"code.gitea.io/gitea/modules/util"
|
||||
|
@ -38,7 +37,7 @@ func ListHooks(ctx *context.APIContext) {
|
|||
// "200":
|
||||
// "$ref": "#/responses/HookList"
|
||||
|
||||
sysHooks, err := webhook.GetSystemWebhooks(ctx, optional.None[bool]())
|
||||
sysHooks, err := webhook.GetSystemWebhooks(ctx, false)
|
||||
if err != nil {
|
||||
ctx.Error(http.StatusInternalServerError, "GetSystemWebhooks", err)
|
||||
return
|
||||
|
|
|
@ -8,7 +8,6 @@ import (
|
|||
|
||||
"code.gitea.io/gitea/models/webhook"
|
||||
"code.gitea.io/gitea/modules/base"
|
||||
"code.gitea.io/gitea/modules/optional"
|
||||
"code.gitea.io/gitea/modules/setting"
|
||||
"code.gitea.io/gitea/services/context"
|
||||
webhook_service "code.gitea.io/gitea/services/webhook"
|
||||
|
@ -36,7 +35,7 @@ func DefaultOrSystemWebhooks(ctx *context.Context) {
|
|||
|
||||
sys["Title"] = ctx.Tr("admin.systemhooks")
|
||||
sys["Description"] = ctx.Tr("admin.systemhooks.desc")
|
||||
sys["Webhooks"], err = webhook.GetSystemWebhooks(ctx, optional.None[bool]())
|
||||
sys["Webhooks"], err = webhook.GetSystemWebhooks(ctx, false)
|
||||
sys["BaseLink"] = setting.AppSubURL + "/admin/hooks"
|
||||
sys["BaseLinkNew"] = setting.AppSubURL + "/admin/system-hooks"
|
||||
sys["WebhookList"] = webhook_service.List()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue