web-installer/src/redux/reducers/channelsReducer.js
// Reducers to add and remove pagerduty configurations from global state
Reducers to add and remove pagerduty configurations from global state
Reducers to add and remove pagerduty configurations from global state
function pagerdutyById(state = {}, action) {
  let parsed = {};
  switch (action.type) {
    case ADD_PAGERDUTY:
      return {
        ...state,
        [action.payload.id]: action.payload,
      };
    case REMOVE_PAGERDUTY:
      return _.omit(state, action.payload.id);
    case ADD_PAGERDUTY_CHANNEL:
      parsed = JSON.parse(JSON.stringify(action.payload));
      return {
        ...state,
        [action.payload.id]: parsed,
      };
    case REMOVE_PAGERDUTY_CHANNEL:
      parsed = JSON.parse(JSON.stringify(action.payload));
      return {
        ...state,
        [action.payload.id]: parsed,
      };
    default:
      return state;
  }
}
function pagerdutyById ( state = { } , action ) { let parsed = { } ; switch ( action . type ) { case ADD_PAGERDUTY : return { ... state , [ action . payload . id ] : action . payload , } ; case REMOVE_PAGERDUTY : return _ . omit ( state , action . payload . id ) ; case ADD_PAGERDUTY_CHANNEL : parsed = JSON . parse ( JSON . stringify ( action . payload ) ) ; return { ... state , [ action . payload . id ] : parsed , } ; case REMOVE_PAGERDUTY_CHANNEL : parsed = JSON . parse ( JSON . stringify ( action . payload ) ) ; return { ... state , [ action . payload . id ] : parsed , } ; default : return state ; } }
Reducers to add and remove pagerduty configurations from global state
Reducers to add and remove pagerduty configurations from global state