initial commit for welsh government planning appeals application
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
export const searchActionTypes = {
|
||||
GETSEARCH: "GETSEARCH",
|
||||
SETSEARCH: "SETSEARCH",
|
||||
UPDATESEARCH: "UPDATESEARCH",
|
||||
};
|
||||
|
||||
export const getSearchObj = () => (dispatch) => {
|
||||
return dispatch({
|
||||
type: searchActionTypes.GETSEARCH,
|
||||
});
|
||||
};
|
||||
|
||||
export const setSearch = (search) => (dispatch) => {
|
||||
return dispatch({
|
||||
type: searchActionTypes.SETSEARCH,
|
||||
searchString: search,
|
||||
});
|
||||
};
|
||||
@@ -0,0 +1,16 @@
|
||||
import { searchActionTypes } from "./action";
|
||||
|
||||
const searchInitialState = {
|
||||
search: {},
|
||||
};
|
||||
|
||||
export default function reducer(state = searchInitialState, action) {
|
||||
switch (action.type) {
|
||||
case searchActionTypes.SETSEARCH:
|
||||
return {
|
||||
searchString: action.searchString,
|
||||
};
|
||||
default:
|
||||
return state;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user