Clean up some variable declarations

This commit is contained in:
Anthony Wang
2022-03-30 15:52:52 -05:00
parent 65016b2664
commit 1da0d49de7
4 changed files with 19 additions and 24 deletions

View File

@@ -78,6 +78,7 @@ func Person(ctx *context.APIContext) {
publicKeyPemProp := streams.NewW3IDSecurityV1PublicKeyPemProperty()
if publicKeyPem, err := activitypub.GetPublicKey(user); err != nil {
ctx.Error(http.StatusInternalServerError, "GetPublicKey", err)
return
} else {
publicKeyPemProp.Set(publicKeyPem)
}
@@ -86,8 +87,10 @@ func Person(ctx *context.APIContext) {
publicKeyProp.AppendW3IDSecurityV1PublicKey(publicKeyType)
person.SetW3IDSecurityV1PublicKey(publicKeyProp)
var jsonmap map[string]interface{}
jsonmap, _ = streams.Serialize(person)
jsonmap, err := streams.Serialize(person)
if err != nil {
ctx.Error(http.StatusInternalServerError, "Serialize", err)
}
ctx.JSON(http.StatusOK, jsonmap)
}