#1692 add CRUD issue APIs

- Fix go-gogs-client#10
- Related to #809
This commit is contained in:
Unknwon
2016-03-13 23:20:22 -04:00
parent dd6faf7f9b
commit 9bd9ad4205
23 changed files with 406 additions and 140 deletions

View File

@@ -26,9 +26,8 @@ func ListHooks(ctx *context.APIContext) {
apiHooks := make([]*api.Hook, len(hooks))
for i := range hooks {
apiHooks[i] = convert.ToApiHook(ctx.Repo.RepoLink, hooks[i])
apiHooks[i] = convert.ToHook(ctx.Repo.RepoLink, hooks[i])
}
ctx.JSON(200, &apiHooks)
}
@@ -94,7 +93,7 @@ func CreateHook(ctx *context.APIContext, form api.CreateHookOption) {
return
}
ctx.JSON(201, convert.ToApiHook(ctx.Repo.RepoLink, w))
ctx.JSON(201, convert.ToHook(ctx.Repo.RepoLink, w))
}
// https://github.com/gogits/go-gogs-client/wiki/Repositories#edit-a-hook
@@ -161,5 +160,5 @@ func EditHook(ctx *context.APIContext, form api.EditHookOption) {
return
}
ctx.JSON(200, convert.ToApiHook(ctx.Repo.RepoLink, w))
ctx.JSON(200, convert.ToHook(ctx.Repo.RepoLink, w))
}