%PDF- %PDF-
Direktori : /home/forge/takeaseat.eco-n-tech.co.uk/store/therapist/ |
Current File : //home/forge/takeaseat.eco-n-tech.co.uk/store/therapist/clients.js |
export const state = () => ({ list: [], meta: [], single: {} }) export const mutations = { setList(state, data) { state.list = data }, setMeta(state, meta) { state.meta = meta }, setSingle(state, data) { state.single = data }, } export const actions = { async get({ commit, error }, payload) { await this.$axios.get('/therapist/clients', { params: payload, }).then((res) => { if (res.status === 200) { commit('setList', res.data.data) commit('setMeta', res.data.meta) } }) }, async single({ commit, error }, client_id) { await this.$axios.get('/therapist/clients/'+client_id) .then((res) => { if (res.status === 200) { commit('setSingle', res.data.data) } }) }, async latest({ commit, error }, payload) { await this.$axios.get('/therapist/clients', { params: payload, }).then((res) => { if (res.status === 200) { commit('setList', res.data.data) commit('setMeta', res.data.meta) } }) }, }