diff --git a/superset-frontend/src/views/CRUD/hooks.ts b/superset-frontend/src/views/CRUD/hooks.ts index a67317e04cd60..54eccad0f9359 100644 --- a/superset-frontend/src/views/CRUD/hooks.ts +++ b/superset-frontend/src/views/CRUD/hooks.ts @@ -330,7 +330,7 @@ export function useSingleViewResource( .then( ({ json = {} }) => { updateState({ - resource: json.result, + resource: { ...json.result, id: json.id }, error: null, }); return json.result; diff --git a/superset/databases/api.py b/superset/databases/api.py index b93f489729900..f095aaf8d1b3f 100644 --- a/superset/databases/api.py +++ b/superset/databases/api.py @@ -331,6 +331,8 @@ def put(self, pk: int) -> Response: changed_model = UpdateDatabaseCommand(g.user, pk, item).run() # Return censored version for sqlalchemy URI item["sqlalchemy_uri"] = changed_model.sqlalchemy_uri + if changed_model.parameters: + item["parameters"] = changed_model.parameters return self.response(200, id=changed_model.id, result=item) except DatabaseNotFoundError: return self.response_404()