my cases portal module by loggedin user
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
export const AccountDetailsDataActionTypes = {
|
||||
GETACCOUNTDETAILSDATA: "GETACCOUNTDETAILSDATA",
|
||||
SETACCOUNTDETAILSDATA: "SETACCOUNTDETAILSDATA",
|
||||
SETLOGGEDINUSER: "SETLOGGEDINUSER",
|
||||
};
|
||||
|
||||
export const getAccountDetailsObj = () => (dispatch) => {
|
||||
@@ -16,6 +17,13 @@ export const setAccountDetails = (accountDetails) => (dispatch) => {
|
||||
});
|
||||
};
|
||||
|
||||
export const setLoggedInUserId = (loggedinUserId) => (dispatch) => {
|
||||
return dispatch({
|
||||
type: AccountDetailsDataActionTypes.SETLOGGEDINUSER,
|
||||
loggedinUserId: loggedinUserId,
|
||||
});
|
||||
};
|
||||
|
||||
export const setLogout = () => (dispatch) => {
|
||||
return dispatch({
|
||||
type: "USER_LOGOUT",
|
||||
|
||||
@@ -2,6 +2,7 @@ import { AccountDetailsDataActionTypes } from "./action";
|
||||
|
||||
const AccountDetailsDataInitialState = {
|
||||
accountDetails: {},
|
||||
loggedinUserId: "",
|
||||
};
|
||||
|
||||
export default function reducer(
|
||||
@@ -14,6 +15,11 @@ export default function reducer(
|
||||
...state,
|
||||
accountDetails: action.accountDetails,
|
||||
};
|
||||
case AccountDetailsDataActionTypes.SETLOGGEDINUSER:
|
||||
return {
|
||||
...state,
|
||||
loggedinUserId: action.loggedinUserId,
|
||||
};
|
||||
default:
|
||||
return state;
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
export const awaitingSubmissionActionTypes = {
|
||||
GETAWAITINGSUBMISSION: "GETAWAITINGSUBMISSION",
|
||||
SETAWAITINGSUBMISSION: "SETAWAITINGSUBMISSION",
|
||||
SETAWAITINGSUBMISSIONDETAILS: "SETAWAITINGSUBMISSIONDETAILS",
|
||||
UPDATEAWAITINGSUBMISSION: "UPDATEAWAITINGSUBMISSION",
|
||||
};
|
||||
|
||||
@@ -16,3 +17,11 @@ export const setAwaitingSubmission = (awaitingSubmission) => (dispatch) => {
|
||||
awaitingSubmission: awaitingSubmission,
|
||||
});
|
||||
};
|
||||
|
||||
export const setAwaitingSubmissionDetails =
|
||||
(awaitingSubmissionDetails) => (dispatch) => {
|
||||
return dispatch({
|
||||
type: awaitingSubmissionActionTypes.SETAWAITINGSUBMISSIONDETAILS,
|
||||
awaitingSubmissionDetails: awaitingSubmissionDetails,
|
||||
});
|
||||
};
|
||||
|
||||
@@ -2,6 +2,7 @@ import { awaitingSubmissionActionTypes } from "./action";
|
||||
|
||||
const awaitingSubmissionInitialState = {
|
||||
awaitingSubmission: {},
|
||||
awaitingSubmissionDetails: {},
|
||||
};
|
||||
|
||||
export default function reducer(
|
||||
@@ -11,8 +12,14 @@ export default function reducer(
|
||||
switch (action.type) {
|
||||
case awaitingSubmissionActionTypes.SETAWAITINGSUBMISSION:
|
||||
return {
|
||||
...state,
|
||||
awaitingSubmission: action.awaitingSubmission,
|
||||
};
|
||||
case awaitingSubmissionActionTypes.SETAWAITINGSUBMISSIONDETAILS:
|
||||
return {
|
||||
...state,
|
||||
awaitingSubmissionDetails: action.awaitingSubmissionDetails,
|
||||
};
|
||||
default:
|
||||
return state;
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@ export const myCasesActionTypes = {
|
||||
GETMYCASES: "GETMYCASES",
|
||||
SETMYCASES: "SETMYCASES",
|
||||
UPDATEMYCASES: "UPDATEMYCASES",
|
||||
SETMYCASESDETAILS: "SETMYCASESDETAILS",
|
||||
};
|
||||
|
||||
export const getMyCasesObj = () => (dispatch) => {
|
||||
@@ -16,3 +17,9 @@ export const setMyCases = (myCases) => (dispatch) => {
|
||||
myCases: myCases,
|
||||
});
|
||||
};
|
||||
export const setMyCasesDetails = (myCasesDetails) => (dispatch) => {
|
||||
return dispatch({
|
||||
type: myCasesActionTypes.SETMYCASESDETAILS,
|
||||
myCasesDetails: myCasesDetails,
|
||||
});
|
||||
};
|
||||
|
||||
@@ -2,14 +2,21 @@ import { myCasesActionTypes } from "./action";
|
||||
|
||||
const myCasesInitialState = {
|
||||
myCases: {},
|
||||
myCasesDetails: {},
|
||||
};
|
||||
|
||||
export default function reducer(state = myCasesInitialState, action) {
|
||||
switch (action.type) {
|
||||
case myCasesActionTypes.SETMYCASES:
|
||||
return {
|
||||
...state,
|
||||
myCases: action.myCases,
|
||||
};
|
||||
case myCasesActionTypes.SETMYCASESDETAILS:
|
||||
return {
|
||||
...state,
|
||||
myCasesDetails: action.myCasesDetails,
|
||||
};
|
||||
default:
|
||||
return state;
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
export const myRepresentationsActionTypes = {
|
||||
GETMYREPRESENTATIONS: "GETMYREPRESENTATIONS",
|
||||
SETMYREPRESENTATIONS: "SETMYREPRESENTATIONS",
|
||||
SETMYREPRESENTATIONSDETAILS: "SETMYREPRESENTATIONSDETAILS",
|
||||
UPDATEMYREPRESENTATIONS: "UPDATEMYREPRESENTATIONS",
|
||||
};
|
||||
|
||||
@@ -16,3 +17,11 @@ export const setMyRepresentations = (myRepresentations) => (dispatch) => {
|
||||
myRepresentations: myRepresentations,
|
||||
});
|
||||
};
|
||||
|
||||
export const setMyRepresentationsDetails =
|
||||
(myRepresentationsDetails) => (dispatch) => {
|
||||
return dispatch({
|
||||
type: myRepresentationsActionTypes.SETMYREPRESENTATIONSDETAILS,
|
||||
myRepresentationsDetails: myRepresentationsDetails,
|
||||
});
|
||||
};
|
||||
|
||||
@@ -2,14 +2,21 @@ import { myRepresentationsActionTypes } from "./action";
|
||||
|
||||
const myRepresentationsInitialState = {
|
||||
myRepresentations: {},
|
||||
myRepresentationsDetails: {},
|
||||
};
|
||||
|
||||
export default function reducer(state = myRepresentationsInitialState, action) {
|
||||
switch (action.type) {
|
||||
case myRepresentationsActionTypes.SETMYREPRESENTATIONS:
|
||||
return {
|
||||
...state,
|
||||
myRepresentations: action.myRepresentations,
|
||||
};
|
||||
case myRepresentationsActionTypes.SETMYREPRESENTATIONSDETAILS:
|
||||
return {
|
||||
...state,
|
||||
myRepresentationsDetails: action.myRepresentationsDetails,
|
||||
};
|
||||
default:
|
||||
return state;
|
||||
}
|
||||
|
||||
+6
-1
@@ -1,5 +1,5 @@
|
||||
import { createStore, applyMiddleware, combineReducers } from "redux";
|
||||
import { createWrapper, HYDRATE } from "next-redux-wrapper";
|
||||
import { createWrapper, HYDRATE, REHYDRATE } from "next-redux-wrapper";
|
||||
import thunkMiddleware from "redux-thunk";
|
||||
import { reducer as formReducer } from "redux-form";
|
||||
import autoMergeLevel2 from "redux-persist/lib/stateReconciler/autoMergeLevel2";
|
||||
@@ -47,6 +47,11 @@ const reducer = (state = {}, action) => {
|
||||
switch (action.type) {
|
||||
case HYDRATE:
|
||||
return { ...state, ...action.payload };
|
||||
case REHYDRATE: {
|
||||
console.log("am rhydrating........");
|
||||
return { ...state, ...action.payload };
|
||||
}
|
||||
|
||||
case "SERVER_ACTION":
|
||||
return {
|
||||
...state,
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
export const watchedCasesActionTypes = {
|
||||
GETWATCHEDCASES: "GETWATCHEDCASES",
|
||||
SETWATCHEDCASES: "SETWATCHEDCASES",
|
||||
SETWATCHEDCASESDETAILS: "SETWATCHEDCASESDETAILS",
|
||||
UPDATEWATCHEDCASES: "UPDATEWATCHEDCASES",
|
||||
};
|
||||
|
||||
@@ -16,3 +17,10 @@ export const setWatchedCases = (watchedCases) => (dispatch) => {
|
||||
watchedCases: watchedCases,
|
||||
});
|
||||
};
|
||||
|
||||
export const setWatchedCasesDetails = (watchedCasesDetails) => (dispatch) => {
|
||||
return dispatch({
|
||||
type: watchedCasesActionTypes.SETWATCHEDCASESDETAILS,
|
||||
watchedCasesDetails: watchedCasesDetails,
|
||||
});
|
||||
};
|
||||
|
||||
@@ -2,14 +2,21 @@ import { watchedCasesActionTypes } from "./action";
|
||||
|
||||
const watchedCasesInitialState = {
|
||||
watchedCases: {},
|
||||
watchedCasesDetails: {},
|
||||
};
|
||||
|
||||
export default function reducer(state = watchedCasesInitialState, action) {
|
||||
switch (action.type) {
|
||||
case watchedCasesActionTypes.SETWATCHEDCASES:
|
||||
return {
|
||||
...state,
|
||||
watchedCases: action.watchedCases,
|
||||
};
|
||||
case watchedCasesActionTypes.SETWATCHEDCASESDETAILS:
|
||||
return {
|
||||
...state,
|
||||
watchedCasesDetails: action.watchedCasesDetails,
|
||||
};
|
||||
default:
|
||||
return state;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user