summaryrefslogtreecommitdiffstats
path: root/routers/api/v1/utils
diff options
context:
space:
mode:
Diffstat (limited to 'routers/api/v1/utils')
-rw-r--r--routers/api/v1/utils/hook.go5
1 files changed, 3 insertions, 2 deletions
diff --git a/routers/api/v1/utils/hook.go b/routers/api/v1/utils/hook.go
index ab67accc5b..e1533da94c 100644
--- a/routers/api/v1/utils/hook.go
+++ b/routers/api/v1/utils/hook.go
@@ -12,6 +12,7 @@ import (
"code.gitea.io/gitea/routers/api/v1/convert"
"encoding/json"
"github.com/Unknwon/com"
+ "net/http"
)
// GetOrgHook get an organization's webhook. If there is an error, write to
@@ -69,7 +70,7 @@ func AddOrgHook(ctx *context.APIContext, form *api.CreateHookOption) {
org := ctx.Org.Organization
hook, ok := addHook(ctx, form, org.ID, 0)
if ok {
- ctx.JSON(200, convert.ToHook(org.HomeLink(), hook))
+ ctx.JSON(http.StatusCreated, convert.ToHook(org.HomeLink(), hook))
}
}
@@ -78,7 +79,7 @@ func AddRepoHook(ctx *context.APIContext, form *api.CreateHookOption) {
repo := ctx.Repo
hook, ok := addHook(ctx, form, 0, repo.Repository.ID)
if ok {
- ctx.JSON(200, convert.ToHook(repo.RepoLink, hook))
+ ctx.JSON(http.StatusCreated, convert.ToHook(repo.RepoLink, hook))
}
}