web-installer/src/redux/reducers/channelsReducer.js
// Reducers to add and remove twilio configurations from global state
Reducers to add and remove twilio configurations from global state
Reducers to add and remove twilio configurations from global state
function twiliosById(state = {}, action) {
  let parsed = {};
  switch (action.type) {
    case ADD_TWILIO:
      return {
        ...state,
        [action.payload.id]: action.payload,
      };
    case REMOVE_TWILIO:
      return _.omit(state, action.payload.id);
    case ADD_TWILIO_CHANNEL:
      parsed = JSON.parse(JSON.stringify(action.payload));
      return {
        ...state,
        [action.payload.id]: parsed,
      };
    case REMOVE_TWILIO_CHANNEL:
      parsed = JSON.parse(JSON.stringify(action.payload));
      return {
        ...state,
        [action.payload.id]: parsed,
      };
    default:
      return state;
  }
}
function twiliosById ( state = { } , action ) { let parsed = { } ; switch ( action . type ) { case ADD_TWILIO : return { ... state , [ action . payload . id ] : action . payload , } ; case REMOVE_TWILIO : return _ . omit ( state , action . payload . id ) ; case ADD_TWILIO_CHANNEL : parsed = JSON . parse ( JSON . stringify ( action . payload ) ) ; return { ... state , [ action . payload . id ] : parsed , } ; case REMOVE_TWILIO_CHANNEL : parsed = JSON . parse ( JSON . stringify ( action . payload ) ) ; return { ... state , [ action . payload . id ] : parsed , } ; default : return state ; } }
Reducers to add and remove twilio configurations from global state
Reducers to add and remove twilio configurations from global state