summaryrefslogtreecommitdiffstats
path: root/routers/api/v1/user/gpg_key.go
diff options
context:
space:
mode:
Diffstat (limited to 'routers/api/v1/user/gpg_key.go')
-rw-r--r--routers/api/v1/user/gpg_key.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/routers/api/v1/user/gpg_key.go b/routers/api/v1/user/gpg_key.go
index 9fbe351c27..7290ef485a 100644
--- a/routers/api/v1/user/gpg_key.go
+++ b/routers/api/v1/user/gpg_key.go
@@ -118,12 +118,12 @@ func GetGPGKey(ctx *context.APIContext) {
// CreateUserGPGKey creates new GPG key to given user by ID.
func CreateUserGPGKey(ctx *context.APIContext, form api.CreateGPGKeyOption, uid int64) {
- key, err := models.AddGPGKey(uid, form.ArmoredKey)
+ keys, err := models.AddGPGKey(uid, form.ArmoredKey)
if err != nil {
HandleAddGPGKeyError(ctx, err)
return
}
- ctx.JSON(http.StatusCreated, convert.ToGPGKey(key))
+ ctx.JSON(http.StatusCreated, convert.ToGPGKey(keys[0]))
}
// swagger:parameters userCurrentPostGPGKey