forked from forgejo/forgejo
use numbers and not http.Status___ enum
This commit is contained in:
parent
e2fc0a0dfd
commit
b1ff386e24
14 changed files with 82 additions and 96 deletions
|
@ -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))
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue