1
0
Fork 0
forked from forgejo/forgejo

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
No known key found for this signature in database
GPG key ID: A1CA74D27FD13271
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))
}
}