aboutsummaryrefslogtreecommitdiff
path: root/resources/js/store.js
diff options
context:
space:
mode:
Diffstat (limited to 'resources/js/store.js')
-rw-r--r--resources/js/store.js13
1 files changed, 13 insertions, 0 deletions
diff --git a/resources/js/store.js b/resources/js/store.js
index 669f0bc..852ba6b 100644
--- a/resources/js/store.js
+++ b/resources/js/store.js
@@ -14,6 +14,9 @@ export default new Vuex.Store({
},
getSigns(state) {
return state.callSigns;
+ },
+ getData(state) {
+ return state.data;
}
},
mutations: {
@@ -22,6 +25,9 @@ export default new Vuex.Store({
},
fillSigns(state, signs) {
state.callSigns = signs;
+ },
+ setData(state, data) {
+ state.data = data;
}
},
actions: {
@@ -34,6 +40,13 @@ export default new Vuex.Store({
}).catch(error => {
console.log(error);
});
+ },
+ async fillData(context) {
+ await axios.post('/api/activities', {'call-sign': this.state.selectedSign}).then(response => {
+ context.commit('setData', response.data.data);
+ }).catch(error => {
+ console.log(error);
+ });
}
}
});