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 opsgenieById(state = {}, action) {
  let parsed = {};
  switch (action.type) {
    case ADD_OPSGENIE:
      return {
        ...state,
        [action.payload.id]: action.payload,
      };
    case REMOVE_OPSGENIE:
      return _.omit(state, action.payload.id);
    case ADD_OPSGENIE_CHANNEL:
      parsed = JSON.parse(JSON.stringify(action.payload));
      return {
        ...state,
        [action.payload.id]: parsed,
      };
    case REMOVE_OPSGENIE_CHANNEL:
      parsed = JSON.parse(JSON.stringify(action.payload));
      return {
        ...state,
        [action.payload.id]: parsed,
      };
    default:
      return state;
  }
}
function opsgenieById ( state = { } , action ) { let parsed = { } ; switch ( action . type ) { case ADD_OPSGENIE : return { ... state , [ action . payload . id ] : action . payload , } ; case REMOVE_OPSGENIE : return _ . omit ( state , action . payload . id ) ; case ADD_OPSGENIE_CHANNEL : parsed = JSON . parse ( JSON . stringify ( action . payload ) ) ; return { ... state , [ action . payload . id ] : parsed , } ; case REMOVE_OPSGENIE_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