admin-fe/src/store/modules/users.js

22 lines
353 B
JavaScript
Raw Normal View History

2019-02-23 21:40:26 +00:00
import { fetchUsers } from '@/api/users'
const user = {
state: {
fetchedUsers: []
},
mutations: {
SET_USERS: (state, users) => {
state.fetchedUsers = users
}
},
actions: {
async FetchUsers({ commit }) {
const response = await fetchUsers()
commit('SET_USERS', response.data)
}
}
}
export default user