Pass DataSource as prop to LayoutTemplate
This commit is contained in:
parent
1e58d8eb4b
commit
e57e0d7de8
@ -38,8 +38,6 @@ function DataSourceWrapper(props) {
|
|||||||
const firstWebApiDataSource = webApiDataSources[0];
|
const firstWebApiDataSource = webApiDataSources[0];
|
||||||
const dataSource = firstWebApiDataSource.createDataSource(dataSourceConfig);
|
const dataSource = firstWebApiDataSource.createDataSource(dataSourceConfig);
|
||||||
|
|
||||||
console.log(dataSource, 'dsm');
|
|
||||||
|
|
||||||
// Route props --> studies.mapParams
|
// Route props --> studies.mapParams
|
||||||
// mapParams --> studies.search
|
// mapParams --> studies.search
|
||||||
// studies.search --> studies.processResults
|
// studies.search --> studies.processResults
|
||||||
@ -68,9 +66,17 @@ function DataSourceWrapper(props) {
|
|||||||
}, [history.location.search]);
|
}, [history.location.search]);
|
||||||
// queryFilterValues
|
// queryFilterValues
|
||||||
|
|
||||||
|
// TODO: Better way to pass DataSource?
|
||||||
return (
|
return (
|
||||||
<React.Fragment>
|
<React.Fragment>
|
||||||
{data && <LayoutTemplate {...rest} history={history} data={data} />}
|
{data && (
|
||||||
|
<LayoutTemplate
|
||||||
|
{...rest}
|
||||||
|
history={history}
|
||||||
|
data={data}
|
||||||
|
dataSource={dataSource}
|
||||||
|
/>
|
||||||
|
)}
|
||||||
</React.Fragment>
|
</React.Fragment>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user