12345678910111213141516171819202122232425 |
- import axios from '~plugins/axios'
- import config from '../nuxt.config'
- export const actions = {
-
- loadMessageCount({ commit }, params = {}) {
- commit('messageCount/REQUEST_MESSAGE_COUNT')
- return axios.get('/messages/count', {params})
- .then(response => {
- commit('messageCount/REQUEST_MESSAGE_COUNT_SUCCESS', response.data)
- }, err => {
- commit('messageCount/REQUEST_MESSAGE_COUNT_FAILURE', err)
- })
- },
-
- getAllMessage({ commit }, params = {}) {
- commit('messageList/REQUEST_MESSAGE_LIST')
- return axios.get(`${config.env.messageUrl}/messages`, {params})
- .then(response => {
- commit('messageList/GET_MESSAGE_LIST_SUCCESS', response.data)
- }, err => {
- commit('messageList/GET_MESSAGE_LIST_FAILURE', err)
- })
- }
- }
|