fix: call external metadata endpoint with correct rison object (#16369)

This commit is contained in:
Ville Brofeldt 2021-08-20 11:43:57 +03:00 committed by GitHub
parent 50d896f1b7
commit 575ee24a99
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 4 deletions

View File

@ -493,11 +493,14 @@ class DatasourceEditor extends React.PureComponent {
schema_name: datasource.schema, schema_name: datasource.schema,
table_name: datasource.table_name, table_name: datasource.table_name,
}; };
const endpoint = `/datasource/external_metadata_by_name/?q=${rison.encode( Object.entries(params).forEach(([key, value]) => {
// rison can't encode the undefined value // rison can't encode the undefined value
Object.keys(params).map(key => if (value === undefined) {
params[key] === undefined ? null : params[key], params[key] = null;
), }
});
const endpoint = `/datasource/external_metadata_by_name/?q=${rison.encode(
params,
)}`; )}`;
this.setState({ metadataLoading: true }); this.setState({ metadataLoading: true });