diff options
author | Unknwon <u@gogs.io> | 2016-03-13 23:20:22 -0400 |
---|---|---|
committer | Unknwon <u@gogs.io> | 2016-03-13 23:20:22 -0400 |
commit | 9bd9ad420582a7a34d18011847bb789f64271b1f (patch) | |
tree | 05b1191897ed5f56395faacd3c8bf1ab00a14c9c /routers/api/v1/user | |
parent | dd6faf7f9bd0a1dbf986e124ea0f4db249e1da48 (diff) | |
download | gitea-9bd9ad420582a7a34d18011847bb789f64271b1f.tar.gz gitea-9bd9ad420582a7a34d18011847bb789f64271b1f.zip |
#1692 add CRUD issue APIs
- Fix go-gogs-client#10
- Related to #809
Diffstat (limited to 'routers/api/v1/user')
-rw-r--r-- | routers/api/v1/user/email.go | 4 | ||||
-rw-r--r-- | routers/api/v1/user/followers.go | 2 | ||||
-rw-r--r-- | routers/api/v1/user/keys.go | 6 |
3 files changed, 6 insertions, 6 deletions
diff --git a/routers/api/v1/user/email.go b/routers/api/v1/user/email.go index fe11954ba7..6a3d525cce 100644 --- a/routers/api/v1/user/email.go +++ b/routers/api/v1/user/email.go @@ -22,7 +22,7 @@ func ListEmails(ctx *context.APIContext) { } apiEmails := make([]*api.Email, len(emails)) for i := range emails { - apiEmails[i] = convert.ToApiEmail(emails[i]) + apiEmails[i] = convert.ToEmail(emails[i]) } ctx.JSON(200, &apiEmails) } @@ -54,7 +54,7 @@ func AddEmail(ctx *context.APIContext, form api.CreateEmailOption) { apiEmails := make([]*api.Email, len(emails)) for i := range emails { - apiEmails[i] = convert.ToApiEmail(emails[i]) + apiEmails[i] = convert.ToEmail(emails[i]) } ctx.JSON(201, &apiEmails) } diff --git a/routers/api/v1/user/followers.go b/routers/api/v1/user/followers.go index 7e00cb3f18..00d1952d59 100644 --- a/routers/api/v1/user/followers.go +++ b/routers/api/v1/user/followers.go @@ -15,7 +15,7 @@ import ( func responseApiUsers(ctx *context.APIContext, users []*models.User) { apiUsers := make([]*api.User, len(users)) for i := range users { - apiUsers[i] = convert.ToApiUser(users[i]) + apiUsers[i] = convert.ToUser(users[i]) } ctx.JSON(200, &apiUsers) } diff --git a/routers/api/v1/user/keys.go b/routers/api/v1/user/keys.go index 3e1ed666e2..7337112ece 100644 --- a/routers/api/v1/user/keys.go +++ b/routers/api/v1/user/keys.go @@ -46,7 +46,7 @@ func listPublicKeys(ctx *context.APIContext, uid int64) { apiLink := composePublicKeysAPILink() apiKeys := make([]*api.PublicKey, len(keys)) for i := range keys { - apiKeys[i] = convert.ToApiPublicKey(apiLink, keys[i]) + apiKeys[i] = convert.ToPublicKey(apiLink, keys[i]) } ctx.JSON(200, &apiKeys) @@ -79,7 +79,7 @@ func GetPublicKey(ctx *context.APIContext) { } apiLink := composePublicKeysAPILink() - ctx.JSON(200, convert.ToApiPublicKey(apiLink, key)) + ctx.JSON(200, convert.ToPublicKey(apiLink, key)) } // CreateUserPublicKey creates new public key to given user by ID. @@ -96,7 +96,7 @@ func CreateUserPublicKey(ctx *context.APIContext, form api.CreateKeyOption, uid return } apiLink := composePublicKeysAPILink() - ctx.JSON(201, convert.ToApiPublicKey(apiLink, key)) + ctx.JSON(201, convert.ToPublicKey(apiLink, key)) } // https://github.com/gogits/go-gogs-client/wiki/Users-Public-Keys#create-a-public-key |