starsz commented on a change in pull request #1436:
URL: https://github.com/apache/apisix-dashboard/pull/1436#discussion_r571525517
##########
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:
In fact, we can only get the value instead of using `ObjectClone()`
```
ssl := ret.(*entity.SSL)
_ssl = *ssl
```
##########
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.
----------------------------------------------------------------
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]