
/**
 * React Native Full App (https://store.enappd.com/product/react-native-full-app)
 *
 * Copyright © 2019-present Enappd. All rights reserved.
 *
 * This source code is licensed as per the terms found in the
 * LICENSE.md file in the root directory of this source tree.
 */
import {
    ADD_PAYMENT_METHOD, GET_PAYMENT_METHODS,
  } from "../types/User";
  
  const INITIAL_STATE: ProductReducerState = {
      paymentMethods: [],
    };
  
  interface ProductReducerState {
    paymentMethods: Array<any>;
  }
    
    export default function (state = INITIAL_STATE, action:any): ProductReducerState {
      switch (action.type) {
        case ADD_PAYMENT_METHOD:
          return { ...state, paymentMethods: action.payload };
        case GET_PAYMENT_METHODS:
          return { ...state, paymentMethods: action.payload };
        default :
          return state
      }
    };