diff --git a/src/js/store/modules/collection/actions.js b/src/js/store/modules/collection/actions.js index 95fed0684..32d636c56 100644 --- a/src/js/store/modules/collection/actions.js +++ b/src/js/store/modules/collection/actions.js @@ -1,4 +1,7 @@ +import axios from '../../../axios/axios'; -export const getItems = () => { - +export const fetchItems = ({ commit, state }) => { + axios.get('/') + .then(res => {}) + .catch(error => console.log( error )); } \ No newline at end of file diff --git a/src/js/store/modules/collection/collection.js b/src/js/store/modules/collection/collection.js index 5b30833e3..4716b276c 100644 --- a/src/js/store/modules/collection/collection.js +++ b/src/js/store/modules/collection/collection.js @@ -2,7 +2,6 @@ import * as actions from './actions'; import * as getters from './getters'; import * as mutations from './mutations'; - const state = { items: [] }; diff --git a/src/js/store/modules/collection/getters.js b/src/js/store/modules/collection/getters.js index e69de29bb..80f9e1f65 100644 --- a/src/js/store/modules/collection/getters.js +++ b/src/js/store/modules/collection/getters.js @@ -0,0 +1,3 @@ +export const getItems = state => { + return state.items; +} \ No newline at end of file diff --git a/src/js/store/modules/collection/mutations.js b/src/js/store/modules/collection/mutations.js index e69de29bb..377857b6f 100644 --- a/src/js/store/modules/collection/mutations.js +++ b/src/js/store/modules/collection/mutations.js @@ -0,0 +1,3 @@ +export const setItems = ( state, items ) => { + state.item = items; +} \ No newline at end of file