imjoey commented on a change in pull request #1436:
URL: https://github.com/apache/apisix-dashboard/pull/1436#discussion_r571527493
##########
File path: api/internal/handler/ssl/ssl.go
##########
@@ -198,7 +198,16 @@ func (h *Handler) Create(c droplet.Context) (interface{},
error) {
return handler.SpecCodeResponse(err), err
}
- return ret, nil
+ //format respond
+ _ssl := &entity.SSL{}
+ err = utils.ObjectClone(ret, _ssl)
Review comment:
> Oh, I only know the `Get` method.
> Because the ret that return by the Get is a point. We will hide the key in
the latter (see line 207 ~ 208). If we don't do the objectClone, then will
influence the value in s.cache.
@starsz thanks for your explanations. Agreed with you for getting the value
instead of cloning. Maybe more comments could be added here for noticing other
developers. As far as I know, we could directly manipulate the returned value
of Create/Update/Patch methods without any side effect. Please correct me if I
was wrong.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]