mirror of
https://github.com/go-gitea/gitea
synced 2025-07-22 18:28:37 +00:00
@@ -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)
|
||||
}
|
||||
|
@@ -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)
|
||||
}
|
||||
|
@@ -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
|
||||
|
Reference in New Issue
Block a user