import axios from 'axios'

export default {
  namespaced: true,
  state: {
    restaurants: []
  },
  mutations: {
    setRestaurants(state, rests) {
      state.restaurants = rests;
    }
  },
  getters: {},
  actions: {
    getRestaurants({
      commit
    }) {
      axios.get('/api/restaurant').then(result => commit('setRestaurants', result.data));
    }
  }
}
