forked from kevadesu/forgejo
parent
dd6faf7f9b
commit
9bd9ad4205
23 changed files with 406 additions and 140 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue