/* eslint-disable no-restricted-syntax */
/* eslint-disable guard-for-in */
import axios from "axios";

export default {
  namespaced: true,
  state: {
    banks: []
  },
  mutations: {
    setBanks(state, items) {
      state.banks = items;
    }
  },
  getters: {},
  actions: {
    getBanks({ commit }) {
      axios
        .get("/api/banks")
        .then(result => commit("setBanks", result.data))
        .catch(error => alert(error.message));
    }
  }
};
