import ajax from '@/server/ajax'
import api from '@/server/api'
// import com from '@/util/common'
export default {
  getDiseaseSummary({commit}) {
    ajax.get({url: api.FILE_URL + 'disease-summary.json'}).then(res => {
      commit('SET_DISEASE_SUM', res)
    })
  },
  getAquafarmPoints({commit}, type) {
    if (type === 'hospital') {
      ajax.get({url: api.FILE_URL + 'hospital-points.json'}).then(res => {
        commit('SET_AQUAFARM_POINTS', res)
      })
      return
    }
    ajax.get({url: api.FILE_URL + 'aquafarm-points.json'}).then(res => {
      commit('SET_AQUAFARM_POINTS', res)
    })
  },
  getDiseaseWarning({commit}) {
    ajax.get({url: api.FILE_URL + 'disease-warning.json'}).then(res => {
      commit('SET_DISEASE_WARNING', res)
    })
  },
}
