import axios from "axios";

export default {
  namespaced: true,
  state: {
    provinces: []
  },
  mutations: {
    setProvince(state, provinces) {
      state.provinces = provinces;
    }
  },
  getters: {},
  actions: {
    getProvince({ commit }) {
      axios
        .get("/api/province")
        .then(result => commit("setProvince", result.data))
        .catch(console.error);
    }
  }
};
