bankingPartnersReducer.js 611 Bytes
import { FETCH_BANKING_PARTNERS_SUCCESS, FETCH_BANKING_PARTNERS_FAIL, CLEAR_ERRORS } from "../constants/bankingPartnersConstants";

// Room details reducer.
export const bankingPartnersReducer = (state = { bankingPartners: [] }, action) => {
  switch (action.type) {
    case FETCH_BANKING_PARTNERS_SUCCESS:
      return {
        bankingPartners: action.payload.data
      };

    case FETCH_BANKING_PARTNERS_FAIL:
      return {
        error: action.payload.error.message
      };

    case CLEAR_ERRORS:
      return {
        ...state,
        error: null
      };

    default:
      return state;
  }
};