web-installer/src/redux/reducers/channelsReducer.js
// Reducers to add and remove email configurations from global state
Reducers to add and remove email configurations from global state
Reducers to add and remove email configurations from global state
function emailsById(state = {}, action) {
  let parsed = {};
  switch (action.type) {
    case ADD_EMAIL:
      return {
        ...state,
        [action.payload.id]: action.payload,
      };
    case REMOVE_EMAIL:
      return _.omit(state, action.payload.id);
    case ADD_EMAIL_CHANNEL:
      parsed = JSON.parse(JSON.stringify(action.payload));
      return {
        ...state,
        [action.payload.id]: parsed,
      };
    case REMOVE_EMAIL_CHANNEL:
      parsed = JSON.parse(JSON.stringify(action.payload));
      return {
        ...state,
        [action.payload.id]: parsed,
      };
    default:
      return state;
  }
}
function emailsById ( state = { } , action ) { let parsed = { } ; switch ( action . type ) { case ADD_EMAIL : return { ... state , [ action . payload . id ] : action . payload , } ; case REMOVE_EMAIL : return _ . omit ( state , action . payload . id ) ; case ADD_EMAIL_CHANNEL : parsed = JSON . parse ( JSON . stringify ( action . payload ) ) ; return { ... state , [ action . payload . id ] : parsed , } ; case REMOVE_EMAIL_CHANNEL : parsed = JSON . parse ( JSON . stringify ( action . payload ) ) ; return { ... state , [ action . payload . id ] : parsed , } ; default : return state ; } }
Reducers to add and remove email configurations from global state
Reducers to add and remove email configurations from global state