mirror of
https://github.com/go-gitea/gitea
synced 2025-07-22 10:18:38 +00:00
use numbers and not http.Status___ enum
This commit is contained in:
@@ -6,7 +6,6 @@ package utils
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"net/http"
|
||||
"strings"
|
||||
|
||||
"code.gitea.io/gitea/models"
|
||||
@@ -74,7 +73,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(http.StatusCreated, convert.ToHook(org.HomeLink(), hook))
|
||||
ctx.JSON(201, convert.ToHook(org.HomeLink(), hook))
|
||||
}
|
||||
}
|
||||
|
||||
@@ -83,7 +82,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(http.StatusCreated, convert.ToHook(repo.RepoLink, hook))
|
||||
ctx.JSON(201, convert.ToHook(repo.RepoLink, hook))
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user