Added status changing information
This commit is contained in:
@@ -48,3 +48,8 @@ export const updateUserDetailsSuccess = userDetails => ({
|
||||
type: UserActionTypes.UPDATE_USER_DETAILS_SUCCESS,
|
||||
payload: userDetails
|
||||
});
|
||||
|
||||
export const setBodyshop = bodyshop => ({
|
||||
type: UserActionTypes.SET_SHOP_DETAILS,
|
||||
payload: bodyshop
|
||||
});
|
||||
|
||||
@@ -3,8 +3,9 @@ import UserActionTypes from "./user.types";
|
||||
const INITIAL_STATE = {
|
||||
currentUser: {
|
||||
authorized: null,
|
||||
language: "en_US"
|
||||
language: "en_us"
|
||||
},
|
||||
bodyshop: null,
|
||||
error: null
|
||||
};
|
||||
|
||||
@@ -41,6 +42,9 @@ const userReducer = (state = INITIAL_STATE, action) => {
|
||||
...action.payload //Spread current user details in.
|
||||
}
|
||||
};
|
||||
|
||||
case UserActionTypes.SET_SHOP_DETAILS:
|
||||
return { ...state, bodyshop: action.payload };
|
||||
case UserActionTypes.SIGN_IN_FAILURE:
|
||||
case UserActionTypes.SIGN_OUT_FAILURE:
|
||||
case UserActionTypes.EMAIL_SIGN_UP_FAILURE:
|
||||
|
||||
@@ -11,3 +11,8 @@ export const selectSignInError = createSelector(
|
||||
[selectUser],
|
||||
user => user.error
|
||||
);
|
||||
|
||||
export const selectBodyshop = createSelector(
|
||||
[selectUser],
|
||||
user => user.bodyshop
|
||||
);
|
||||
|
||||
@@ -14,6 +14,7 @@ const UserActionTypes = {
|
||||
UNAUTHORIZED_USER: "UNAUTHORIZED_USER",
|
||||
SET_USER_LANGUAGE: "SET_USER_LANGUAGE",
|
||||
UPDATE_USER_DETAILS: "UPDATE_USER_DETAILS",
|
||||
UPDATE_USER_DETAILS_SUCCESS: "UPDATE_USER_DETAILS_SUCCESS"
|
||||
UPDATE_USER_DETAILS_SUCCESS: "UPDATE_USER_DETAILS_SUCCESS",
|
||||
SET_SHOP_DETAILS: "SET_SHOP_DETAILS"
|
||||
};
|
||||
export default UserActionTypes;
|
||||
|
||||
Reference in New Issue
Block a user