summaryrefslogtreecommitdiffstats
path: root/routers/api/v1/misc
diff options
context:
space:
mode:
authorUnknwon <u@gogs.io>2016-03-13 18:49:16 -0400
committerUnknwon <u@gogs.io>2016-03-13 18:49:16 -0400
commitdd6faf7f9bd0a1dbf986e124ea0f4db249e1da48 (patch)
tree7f9e4107eb961712a56160ef544143eee3771653 /routers/api/v1/misc
parentdb4da7beecd6a8f65bfa264ba18a8cb12303921f (diff)
downloadgitea-dd6faf7f9bd0a1dbf986e124ea0f4db249e1da48.tar.gz
gitea-dd6faf7f9bd0a1dbf986e124ea0f4db249e1da48.zip
Convert all API handers to use *context.APIContext
Diffstat (limited to 'routers/api/v1/misc')
-rw-r--r--routers/api/v1/misc/markdown.go8
1 files changed, 4 insertions, 4 deletions
diff --git a/routers/api/v1/misc/markdown.go b/routers/api/v1/misc/markdown.go
index 658f495ee5..64895db072 100644
--- a/routers/api/v1/misc/markdown.go
+++ b/routers/api/v1/misc/markdown.go
@@ -12,9 +12,9 @@ import (
)
// https://github.com/gogits/go-gogs-client/wiki/Miscellaneous#render-an-arbitrary-markdown-document
-func Markdown(ctx *context.Context, form api.MarkdownOption) {
+func Markdown(ctx *context.APIContext, form api.MarkdownOption) {
if ctx.HasApiError() {
- ctx.APIError(422, "", ctx.GetErrMsg())
+ ctx.Error(422, "", ctx.GetErrMsg())
return
}
@@ -32,10 +32,10 @@ func Markdown(ctx *context.Context, form api.MarkdownOption) {
}
// https://github.com/gogits/go-gogs-client/wiki/Miscellaneous#render-a-markdown-document-in-raw-mode
-func MarkdownRaw(ctx *context.Context) {
+func MarkdownRaw(ctx *context.APIContext) {
body, err := ctx.Req.Body().Bytes()
if err != nil {
- ctx.APIError(422, "", err)
+ ctx.Error(422, "", err)
return
}
ctx.Write(markdown.RenderRaw(body, ""))