initial dynamic forms
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
export const appealTypeDataActionTypes = {
|
||||
GETAPPEALTYPEDATA: "GETAPPEALTYPEDATA",
|
||||
SETAPPEALTYPEDATA: "SETAPPEALTYPEDATA",
|
||||
UPDATEAPPEALTYPEDATA: "UPDATEAPPEALTYPEDATA",
|
||||
};
|
||||
|
||||
export const getAppealTypeObj = () => (dispatch) => {
|
||||
return dispatch({
|
||||
type: appealTypeDataActionTypes.GETAPPEALTYPEDATA,
|
||||
});
|
||||
};
|
||||
|
||||
export const setAppealType = (appealTypeData) => (dispatch) => {
|
||||
return dispatch({
|
||||
type: appealTypeDataActionTypes.SETAPPEALTYPEDATA,
|
||||
appealType: appealTypeData,
|
||||
});
|
||||
};
|
||||
@@ -0,0 +1,16 @@
|
||||
import { appealTypeDataActionTypes } from "./action";
|
||||
|
||||
const appealTypeDataInitialState = {
|
||||
appealType: {},
|
||||
};
|
||||
|
||||
export default function reducer(state = appealTypeDataInitialState, action) {
|
||||
switch (action.type) {
|
||||
case appealTypeDataActionTypes.SETAPPEALTYPEDATA:
|
||||
return {
|
||||
appealType: action.appealType,
|
||||
};
|
||||
default:
|
||||
return state;
|
||||
}
|
||||
}
|
||||
+3
-1
@@ -5,6 +5,7 @@ import progress from "./progress/reducer";
|
||||
import search from "./search/reducer";
|
||||
import searchResultsObj from "./searchOutput/reducer";
|
||||
import formData from "./formData/reducer";
|
||||
import appealType from "./appealType/reducer";
|
||||
import { reducer as formReducer } from "redux-form";
|
||||
import autoMergeLevel2 from "redux-persist/lib/stateReconciler/autoMergeLevel2";
|
||||
|
||||
@@ -14,6 +15,7 @@ const combinedReducer = combineReducers({
|
||||
search,
|
||||
searchResultsObj,
|
||||
formData,
|
||||
appealType,
|
||||
});
|
||||
|
||||
const reducer = (state = { progress: "{}" }, action) => {
|
||||
@@ -74,7 +76,7 @@ const makeStore = ({ isServer }) => {
|
||||
|
||||
const persistConfig = {
|
||||
key: "nextjs",
|
||||
whitelist: ["progress,search,searchResults,formData"],
|
||||
whitelist: ["progress,search,searchResults,formData,appealType"],
|
||||
storage,
|
||||
stateReconciler: autoMergeLevel2, // if needed, use a safer storage
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user