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

fetchResults: add optional clearTableData param

parent e8991297
No related branches found
No related tags found
No related merge requests found
......@@ -75,14 +75,16 @@ export const fetchResults = ({
facetClass,
uri = null,
limit = null,
optimize = null
optimize = null,
clearTableData = false
}) => ({
type: FETCH_RESULTS,
resultClass,
facetClass,
uri,
limit,
optimize
optimize,
clearTableData
})
export const fetchInstanceAnalysis = ({
resultClass,
......
import { has, isEmpty } from 'lodash'
import { UPDATE_FACET_VALUES_CONSTRAIN_SELF } from '../../actions'
export const fetchResults = state => {
export const fetchResults = (state, action) => {
console.log(action)
return {
...state,
instance: null,
instanceTableData: null,
instanceTableExternalData: null,
fetching: true
fetching: true,
...(action.clearTableData && { instanceTableData: null })
}
}
......
......@@ -41,7 +41,7 @@ export const handleDataFetchingAction = (state, action) => {
case FETCH_RESULTS:
case FETCH_PAGINATED_RESULTS:
case FETCH_BY_URI:
return fetchResults(state)
return fetchResults(state, action)
case FETCH_RESULT_COUNT:
return fetchResultCount(state)
case FETCH_INSTANCE_ANALYSIS:
......
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