diff options
Diffstat (limited to 'routers/api/v1/org')
-rw-r--r-- | routers/api/v1/org/hook.go | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/routers/api/v1/org/hook.go b/routers/api/v1/org/hook.go index c5982300eb..6c81616170 100644 --- a/routers/api/v1/org/hook.go +++ b/routers/api/v1/org/hook.go @@ -7,7 +7,7 @@ package org import ( "net/http" - "code.gitea.io/gitea/models" + "code.gitea.io/gitea/models/webhook" "code.gitea.io/gitea/modules/context" "code.gitea.io/gitea/modules/convert" api "code.gitea.io/gitea/modules/structs" @@ -40,18 +40,18 @@ func ListHooks(ctx *context.APIContext) { // "200": // "$ref": "#/responses/HookList" - opts := &models.ListWebhookOptions{ + opts := &webhook.ListWebhookOptions{ ListOptions: utils.GetListOptions(ctx), OrgID: ctx.Org.Organization.ID, } - count, err := models.CountWebhooksByOpts(opts) + count, err := webhook.CountWebhooksByOpts(opts) if err != nil { ctx.InternalServerError(err) return } - orgHooks, err := models.ListWebhooksByOpts(opts) + orgHooks, err := webhook.ListWebhooksByOpts(opts) if err != nil { ctx.InternalServerError(err) return @@ -191,8 +191,8 @@ func DeleteHook(ctx *context.APIContext) { org := ctx.Org.Organization hookID := ctx.ParamsInt64(":id") - if err := models.DeleteWebhookByOrgID(org.ID, hookID); err != nil { - if models.IsErrWebhookNotExist(err) { + if err := webhook.DeleteWebhookByOrgID(org.ID, hookID); err != nil { + if webhook.IsErrWebhookNotExist(err) { ctx.NotFound() } else { ctx.Error(http.StatusInternalServerError, "DeleteWebhookByOrgID", err) |