Skip to content
Snippets Groups Projects
Commit 2176a892 authored by esikkala's avatar esikkala
Browse files

Clear old results before fetching new results

parent e4bb4563
No related branches found
No related tags found
No related merge requests found
......@@ -81,6 +81,7 @@ const IntegrationAutosuggest = (props) => {
const handleOnSuggestionSelected = () => {
console.log('fetching results');
props.clearResults();
props.fetchResults();
};
......@@ -88,6 +89,7 @@ const IntegrationAutosuggest = (props) => {
if (event.key === 'Enter') {
console.log('fetching results');
autosuggestDOM.current.input.blur();
props.clearResults();
props.fetchResults();
}
};
......@@ -157,6 +159,7 @@ IntegrationAutosuggest.propTypes = {
fetchSuggestions: PropTypes.func.isRequired,
clearSuggestions: PropTypes.func.isRequired,
fetchResults: PropTypes.func.isRequired,
clearResults: PropTypes.func.isRequired
};
export default withStyles(styles)(IntegrationAutosuggest);
......@@ -28,6 +28,7 @@ import {
fetchSuggestions,
clearSuggestions,
fetchResults,
clearResults,
openDrawer,
closeDrawer,
setMapReady,
......@@ -153,6 +154,7 @@ let MapApp = (props) => {
fetchSuggestions={props.fetchSuggestions}
clearSuggestions={props.clearSuggestions}
fetchResults={props.fetchResults}
clearResults={props.clearResults}
/>
{props.search.results.length > 0 &&
<SimpleTable data={props.search.results} />
......@@ -239,6 +241,7 @@ const mapDispatchToProps = ({
fetchSuggestions,
clearSuggestions,
fetchResults,
clearResults,
setMapReady,
getGeoJSON
});
......@@ -256,6 +259,7 @@ MapApp.propTypes = {
fetchSuggestions: PropTypes.func.isRequired,
clearSuggestions: PropTypes.func.isRequired,
fetchResults: PropTypes.func.isRequired,
clearResults: PropTypes.func.isRequired,
setMapReady: PropTypes.func.isRequired,
geoJSON: PropTypes.object.isRequired,
geoJSONKey: PropTypes.number,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment