1
1
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:
6543
2019-12-19 23:55:23 +01:00
parent e2fc0a0dfd
commit b1ff386e24
14 changed files with 82 additions and 96 deletions

View File

@@ -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))
}
}