AAfghahi commented on code in PR #21523:
URL: https://github.com/apache/superset/pull/21523#discussion_r996019005


##########
superset-frontend/src/views/CRUD/data/database/DatabaseModal/index.tsx:
##########
@@ -271,26 +276,44 @@ function dbReducer(
         [action.payload.name]: action.payload.value,
       };
     case ActionType.parametersChange:
-      if (
-        trimmedState.catalog !== undefined &&
-        action.payload.type?.startsWith('catalog')
-      ) {
-        // Formatting wrapping google sheets table catalog
-        const idx = action.payload.type?.split('-')[1];
-        const catalogToUpdate = trimmedState?.catalog[idx] || {};
-        catalogToUpdate[action.payload.name] = action.payload.value;
-
-        const paramatersCatalog = {};
-        // eslint-disable-next-line array-callback-return
-        trimmedState.catalog?.map((item: CatalogObject) => {
-          paramatersCatalog[item.name] = item.value;
-        });
-
+      if (action.payload.type?.startsWith('catalog')) {

Review Comment:
   why have this be a nested loop?



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to