added back missing files
This commit is contained in:
@@ -7,6 +7,7 @@ export const appealTypeDataActionTypes = {
|
||||
SETAPPEALTYPETITLEDATA: "SETAPPEALTYPETITLEDATA",
|
||||
UPDATEAPPEALTYPEDATA: "UPDATEAPPEALTYPEDATA",
|
||||
SETCURRENTSECTION: "SETCURRENTSECTION",
|
||||
SETAPPEALLPA: "SETAPPEALLPA",
|
||||
};
|
||||
|
||||
export const getAppealTypeObj = () => (dispatch) => {
|
||||
@@ -41,3 +42,9 @@ export const setCurrentSection = (currentSection) => (dispatch) => {
|
||||
currentSection: currentSection,
|
||||
});
|
||||
};
|
||||
export const setAppealLPA = (appealLPA) => (dispatch) => {
|
||||
return dispatch({
|
||||
type: appealTypeDataActionTypes.SETAPPEALLPA,
|
||||
appealLPA: appealLPA,
|
||||
});
|
||||
};
|
||||
|
||||
@@ -5,6 +5,7 @@ const appealTypeDataInitialState = {
|
||||
appealTypeTitle: {},
|
||||
appealTypeID: {},
|
||||
currentSection: 1,
|
||||
appealLPA: "",
|
||||
};
|
||||
|
||||
export default function reducer(state = appealTypeDataInitialState, action) {
|
||||
@@ -29,6 +30,12 @@ export default function reducer(state = appealTypeDataInitialState, action) {
|
||||
...state,
|
||||
currentSection: action.currentSection,
|
||||
};
|
||||
case appealTypeDataActionTypes.SETAPPEALLPA:
|
||||
return {
|
||||
...state,
|
||||
appealLPA: action.appealLPA,
|
||||
};
|
||||
|
||||
default:
|
||||
return state;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
import { actionTypes } from "redux-form";
|
||||
|
||||
export const LPADataActionTypes = {
|
||||
GETLPADATA: "GETLPADATA",
|
||||
SETLPADATA: "SETLPADATA",
|
||||
};
|
||||
|
||||
export const getLPAObj = () => (dispatch) => {
|
||||
return dispatch({
|
||||
type: LPADataActionTypes.GETLPADATA,
|
||||
});
|
||||
};
|
||||
|
||||
export const setLPA = (lpaData) => (dispatch) => {
|
||||
return dispatch({
|
||||
type: LPADataActionTypes.SETLPADATA,
|
||||
LPAData: lpaData,
|
||||
});
|
||||
};
|
||||
@@ -0,0 +1,17 @@
|
||||
import { LPADataActionTypes } from "./action";
|
||||
|
||||
const LPADataInitialState = {
|
||||
LPAData: {},
|
||||
};
|
||||
|
||||
export default function reducer(state = LPADataInitialState, action) {
|
||||
switch (action.type) {
|
||||
case LPADataActionTypes.SETLPADATA:
|
||||
return {
|
||||
...state,
|
||||
LPAData: action.LPAData,
|
||||
};
|
||||
default:
|
||||
return state;
|
||||
}
|
||||
}
|
||||
+4
-5
@@ -1,28 +1,27 @@
|
||||
import { createStore, applyMiddleware, combineReducers } from "redux";
|
||||
import { createWrapper, HYDRATE } from "next-redux-wrapper";
|
||||
import thunkMiddleware from "redux-thunk";
|
||||
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 LPAData from "./lpa/reducer";
|
||||
import { reducer as formReducer } from "redux-form";
|
||||
import autoMergeLevel2 from "redux-persist/lib/stateReconciler/autoMergeLevel2";
|
||||
|
||||
//COMBINING ALL REDUCERS
|
||||
const combinedReducer = combineReducers({
|
||||
progress,
|
||||
search,
|
||||
searchResultsObj,
|
||||
formData,
|
||||
appealType,
|
||||
LPAData,
|
||||
form: formReducer,
|
||||
});
|
||||
|
||||
const reducer = (state = { progress: "{}" }, action) => {
|
||||
const reducer = (state = {}, action) => {
|
||||
switch (action.type) {
|
||||
case HYDRATE:
|
||||
//if (action.payload.progress === '{}') delete action.payload.progress;
|
||||
return { ...state, ...action.payload };
|
||||
case "SERVER_ACTION":
|
||||
return {
|
||||
@@ -78,12 +77,12 @@ const makeStore = ({ isServer }) => {
|
||||
const persistConfig = {
|
||||
key: "nextjs",
|
||||
whitelist: [
|
||||
"progress",
|
||||
"search",
|
||||
"searchResults",
|
||||
"formData",
|
||||
"appealType",
|
||||
"form",
|
||||
"LPAData",
|
||||
],
|
||||
storage,
|
||||
stateReconciler: autoMergeLevel2, // if needed, use a safer storage
|
||||
|
||||
Reference in New Issue
Block a user