web-installer/src/redux/reducers/channelsReducer.js
// Reducers to add and remove slack configurations from global state
Reducers to add and remove slack configurations from global state
Reducers to add and remove slack configurations from global state
function slacksById(state = {}, action) {
  let parsed = {};
  switch (action.type) {
    case ADD_SLACK:
      return {
        ...state,
        [action.payload.id]: action.payload,
      };
    case REMOVE_SLACK:
      return _.omit(state, action.payload.id);
    case ADD_SLACK_CHANNEL:
      parsed = JSON.parse(JSON.stringify(action.payload));
      return {
        ...state,
        [action.payload.id]: parsed,
      };
    case REMOVE_SLACK_CHANNEL:
      parsed = JSON.parse(JSON.stringify(action.payload));
      return {
        ...state,
        [action.payload.id]: parsed,
      };
    default:
      return state;
  }
}
function slacksById ( state = { } , action ) { let parsed = { } ; switch ( action . type ) { case ADD_SLACK : return { ... state , [ action . payload . id ] : action . payload , } ; case REMOVE_SLACK : return _ . omit ( state , action . payload . id ) ; case ADD_SLACK_CHANNEL : parsed = JSON . parse ( JSON . stringify ( action . payload ) ) ; return { ... state , [ action . payload . id ] : parsed , } ; case REMOVE_SLACK_CHANNEL : parsed = JSON . parse ( JSON . stringify ( action . payload ) ) ; return { ... state , [ action . payload . id ] : parsed , } ; default : return state ; } }
Reducers to add and remove slack configurations from global state
Reducers to add and remove slack configurations from global state