You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by GitBox <gi...@apache.org> on 2022/02/28 13:45:25 UTC
[GitHub] [superset] villebro commented on a change in pull request #18960: fix(chart): deprecate peristing url_params
villebro commented on a change in pull request #18960:
URL: https://github.com/apache/superset/pull/18960#discussion_r815900588
##########
File path: superset/charts/api.py
##########
@@ -283,7 +283,7 @@ def post(self) -> Response:
return self.response_400(message=error.messages)
try:
new_model = CreateChartCommand(g.user, item).run()
- return self.response(201, id=new_model.id, result=item)
+ return self.response(201, id=new_model.id, result=new_model.to_json())
Review comment:
Since the model is mutated on the command, we need to return the final metadata, not the original one.
##########
File path: superset/charts/api.py
##########
@@ -354,7 +354,9 @@ def put(self, pk: int) -> Response:
return self.response_400(message=error.messages)
try:
changed_model = UpdateChartCommand(g.user, pk, item).run()
- response = self.response(200, id=changed_model.id, result=item)
+ response = self.response(
+ 200, id=changed_model.id, result=changed_model.to_json()
Review comment:
same here
--
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.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org