init crater

This commit is contained in:
Mohit Panjwani
2019-11-11 12:16:00 +05:30
commit bdf2ba51d6
668 changed files with 158503 additions and 0 deletions

View File

@ -0,0 +1,25 @@
import * as types from './mutation-types'
export const loadData = ({ commit, dispatch, state }, params) => {
return new Promise((resolve, reject) => {
window.axios.get(`/api/dashboard`, {params}).then((response) => {
commit(types.SET_INITIAL_DATA, response.data)
commit(types.GET_INITIAL_DATA, true)
resolve(response)
}).catch((err) => {
reject(err)
})
})
}
export const getChart = ({ commit, dispatch, state }) => {
return new Promise((resolve, reject) => {
window.axios.get(`/api/dashboard/expense/chart`).then((response) => {
commit(types.SET_INITIAL_DATA, response.data)
resolve(response)
}).catch((err) => {
reject(err)
})
})
}