Merge from git
This commit is contained in:
@@ -2,6 +2,9 @@ export const searchResultsActionTypes = {
|
||||
GETSEARCHRESULTS: "GETSEARCHRESULTS",
|
||||
SETSEARCHRESULTS: "SETSEARCHRESULTS",
|
||||
UPDATESEARCHRESULTS: "UPDATESEARCHRESULTS",
|
||||
SETSEARCHDETAILS: "SETSEARCHDETAILS",
|
||||
SETDOCUMENTDETAILS: "SETDOCUMENTDETAILS",
|
||||
SETDOCUMENTHISTORY: "SETDOCUMENTHISTORY",
|
||||
};
|
||||
|
||||
export const getSearchResultshObj = () => (dispatch) => {
|
||||
@@ -16,3 +19,23 @@ export const setSearchResults = (searchResults) => (dispatch) => {
|
||||
searchResultsObj: searchResults,
|
||||
});
|
||||
};
|
||||
|
||||
export const setSearchDetails = (searchDetails) => (dispatch) => {
|
||||
return dispatch({
|
||||
type: searchResultsActionTypes.SETSEARCHDETAILS,
|
||||
searchDetailsObj: searchDetails,
|
||||
});
|
||||
};
|
||||
export const setDocumentDetails = (documentDetails) => (dispatch) => {
|
||||
return dispatch({
|
||||
type: searchResultsActionTypes.SETDOCUMENTDETAILS,
|
||||
documentDetailsObj: documentDetails,
|
||||
});
|
||||
};
|
||||
|
||||
export const setDocumentHistory = (documentHistory) => (dispatch) => {
|
||||
return dispatch({
|
||||
type: searchResultsActionTypes.SETDOCUMENTHISTORY,
|
||||
documentHistoryObj: documentHistory,
|
||||
});
|
||||
};
|
||||
|
||||
@@ -2,14 +2,33 @@ import { searchResultsActionTypes } from "./action";
|
||||
|
||||
const searchResultsInitialState = {
|
||||
searchResultsObj: {},
|
||||
searchDetailsObj: {},
|
||||
documentDetailsObj: {},
|
||||
documentHistoryObj: {},
|
||||
};
|
||||
|
||||
export default function reducer(state = searchResultsInitialState, action) {
|
||||
switch (action.type) {
|
||||
case searchResultsActionTypes.SETSEARCHRESULTS:
|
||||
return {
|
||||
...state,
|
||||
searchResultsObj: action.searchResultsObj,
|
||||
};
|
||||
case searchResultsActionTypes.SETSEARCHDETAILS:
|
||||
return {
|
||||
...state,
|
||||
searchDetailsObj: action.searchDetailsObj,
|
||||
};
|
||||
case searchResultsActionTypes.SETDOCUMENTDETAILS:
|
||||
return {
|
||||
...state,
|
||||
documentDetailsObj: action.documentDetailsObj,
|
||||
};
|
||||
case searchResultsActionTypes.SETDOCUMENTHISTORY:
|
||||
return {
|
||||
...state,
|
||||
documentHistoryObj: action.documentHistoryObj,
|
||||
};
|
||||
default:
|
||||
return state;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user