initial commit for welsh government planning appeals application
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
export const searchResultsActionTypes = {
|
||||
GETSEARCHRESULTS: "GETSEARCHRESULTS",
|
||||
SETSEARCHRESULTS: "SETSEARCHRESULTS",
|
||||
UPDATESEARCHRESULTS: "UPDATESEARCHRESULTS",
|
||||
};
|
||||
|
||||
export const getSearchResultshObj = () => (dispatch) => {
|
||||
return dispatch({
|
||||
type: searchResultsActionTypes.GETSEARCHRESULTS,
|
||||
});
|
||||
};
|
||||
|
||||
export const setSearchResults = (searchResults) => (dispatch) => {
|
||||
return dispatch({
|
||||
type: searchResultsActionTypes.SETSEARCHRESULTS,
|
||||
searchResultsObj: searchResults,
|
||||
});
|
||||
};
|
||||
@@ -0,0 +1,16 @@
|
||||
import { searchResultsActionTypes } from "./action";
|
||||
|
||||
const searchResultsInitialState = {
|
||||
searchResultsObj: {},
|
||||
};
|
||||
|
||||
export default function reducer(state = searchResultsInitialState, action) {
|
||||
switch (action.type) {
|
||||
case searchResultsActionTypes.SETSEARCHRESULTS:
|
||||
return {
|
||||
searchResultsObj: action.searchResultsObj,
|
||||
};
|
||||
default:
|
||||
return state;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user