From 70cfb7752c92d88a134466b705f8c4508b225126 Mon Sep 17 00:00:00 2001 From: Lyndsi Kay Williams <55605634+lyndsiWilliams@users.noreply.github.com> Date: Wed, 21 Apr 2021 12:41:50 -0500 Subject: [PATCH] chore: Code cleanup in DatabaseModal (#14196) --- .../src/views/CRUD/data/database/DatabaseModal.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/superset-frontend/src/views/CRUD/data/database/DatabaseModal.tsx b/superset-frontend/src/views/CRUD/data/database/DatabaseModal.tsx index 693b87f5cf..7df7c3e397 100644 --- a/superset-frontend/src/views/CRUD/data/database/DatabaseModal.tsx +++ b/superset-frontend/src/views/CRUD/data/database/DatabaseModal.tsx @@ -89,7 +89,7 @@ const DatabaseModal: FunctionComponent = ({ } const connection = { - sqlalchemy_uri: db ? db.sqlalchemy_uri : '', + sqlalchemy_uri: db?.sqlalchemy_uri || '', database_name: db?.database_name?.trim() || undefined, impersonate_user: db?.impersonate_user || undefined, extra: db?.extra || undefined, @@ -120,7 +120,7 @@ const DatabaseModal: FunctionComponent = ({ delete update.id; } - if (db && db.id) { + if (db?.id) { updateResource(db.id, update).then(result => { if (result) { if (onDatabaseAdd) {