summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--routers/api/v1/misc/markdown_test.go4
-rw-r--r--routers/api/v1/user/app.go10
2 files changed, 10 insertions, 4 deletions
diff --git a/routers/api/v1/misc/markdown_test.go b/routers/api/v1/misc/markdown_test.go
index ae7a445e86..182b147820 100644
--- a/routers/api/v1/misc/markdown_test.go
+++ b/routers/api/v1/misc/markdown_test.go
@@ -28,9 +28,9 @@ func createContext(req *http.Request) (*macaron.Context, *httptest.ResponseRecor
resp := httptest.NewRecorder()
c := &macaron.Context{
Injector: inject.New(),
- Req: macaron.Request{req},
+ Req: macaron.Request{Request: req},
Resp: macaron.NewResponseWriter(resp),
- Render: &macaron.DummyRender{resp},
+ Render: &macaron.DummyRender{ResponseWriter: resp},
Data: make(map[string]interface{}),
}
c.Map(c)
diff --git a/routers/api/v1/user/app.go b/routers/api/v1/user/app.go
index 2955f78a77..6d5a271f79 100644
--- a/routers/api/v1/user/app.go
+++ b/routers/api/v1/user/app.go
@@ -22,7 +22,10 @@ func ListAccessTokens(ctx *context.APIContext) {
apiTokens := make([]*api.AccessToken, len(tokens))
for i := range tokens {
- apiTokens[i] = &api.AccessToken{tokens[i].Name, tokens[i].Sha1}
+ apiTokens[i] = &api.AccessToken{
+ Name: tokens[i].Name,
+ Sha1: tokens[i].Sha1,
+ }
}
ctx.JSON(200, &apiTokens)
}
@@ -38,5 +41,8 @@ func CreateAccessToken(ctx *context.APIContext, form api.CreateAccessTokenOption
ctx.Error(500, "NewAccessToken", err)
return
}
- ctx.JSON(201, &api.AccessToken{t.Name, t.Sha1})
+ ctx.JSON(201, &api.AccessToken{
+ Name: t.Name,
+ Sha1: t.Sha1,
+ })
}