From 84e8a905c99543d18d866f9209de556778b6d0fb Mon Sep 17 00:00:00 2001 From: Jack Fisher Date: Fri, 22 Nov 2024 15:23:26 -0600 Subject: [PATCH] adding types --- .../src/components/Datasource/DatasourceModal.tsx | 2 +- superset-frontend/src/explore/actions/exploreActions.ts | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/superset-frontend/src/components/Datasource/DatasourceModal.tsx b/superset-frontend/src/components/Datasource/DatasourceModal.tsx index 408614fea37ce..5d47b349bb1ce 100644 --- a/superset-frontend/src/components/Datasource/DatasourceModal.tsx +++ b/superset-frontend/src/components/Datasource/DatasourceModal.tsx @@ -191,7 +191,7 @@ const DatasourceModal: FunctionComponent = ({ endpoint: `/api/v1/dataset/${currentDatasource.id}`, jsonPayload: buildPayload({ ...currentDatasource, - columns: syncedDatasource.columns, + columns: syncedDatasource?.columns, }), }); } diff --git a/superset-frontend/src/explore/actions/exploreActions.ts b/superset-frontend/src/explore/actions/exploreActions.ts index b674ff25d5faf..b7588fdf76c4d 100644 --- a/superset-frontend/src/explore/actions/exploreActions.ts +++ b/superset-frontend/src/explore/actions/exploreActions.ts @@ -34,6 +34,7 @@ import { import { Slice } from 'src/types/Chart'; import { SaveActionType } from 'src/explore/types'; import { updateColumns } from 'src/components/Datasource/utils'; +import { ExplorePageState } from '../types'; export const UPDATE_FORM_DATA_BY_DATASOURCE = 'UPDATE_FORM_DATA_BY_DATASOURCE'; export function updateFormDataByDatasource( @@ -183,7 +184,10 @@ export function stopMetaDataLoading() { export const SYNC_DATASOURCE_METADATA = 'SYNC_DATASOURCE_METADATA'; export function syncDatasourceMetadata() { - return async function (dispatch: Dispatch, getState) { + return async function ( + dispatch: Dispatch, + getState: () => ExplorePageState, + ): Promise { const { explore: { datasource }, } = getState();