summaryrefslogtreecommitdiffstats
path: root/webapp/src/store
diff options
context:
space:
mode:
authorUdo Walter2018-11-12 05:59:16 +0100
committerUdo Walter2018-11-12 05:59:16 +0100
commit5a15373dcd76ed7371dbbee88104dd0c4384a889 (patch)
tree1d2c798f7602e17c007d67d279a7cb1ee754b053 /webapp/src/store
parent[iDoIT] Rework the import method to use batch requests (diff)
downloadbas-5a15373dcd76ed7371dbbee88104dd0c4384a889.tar.gz
bas-5a15373dcd76ed7371dbbee88104dd0c4384a889.tar.xz
bas-5a15373dcd76ed7371dbbee88104dd0c4384a889.zip
[registration] add configurator for registration hooks
Diffstat (limited to 'webapp/src/store')
-rw-r--r--webapp/src/store/registration.js40
1 files changed, 40 insertions, 0 deletions
diff --git a/webapp/src/store/registration.js b/webapp/src/store/registration.js
new file mode 100644
index 0000000..388558d
--- /dev/null
+++ b/webapp/src/store/registration.js
@@ -0,0 +1,40 @@
+import axios from 'axios'
+
+export default {
+ namespaced: true,
+ state: {
+ hooks: [],
+ groupList: [],
+ dialog: {
+ show: false,
+ type: null,
+ info: {}
+ }
+ },
+ mutations: {
+ setHooks (state, hooks) { state.hooks = hooks },
+ setGroupList (state, groupList) { state.groupList = groupList },
+ setDialog (state, { show, type, info }) {
+ if (info !== undefined) state.dialog.info = info
+ if (type !== undefined) state.dialog.type = type
+ if (show !== undefined) state.dialog.show = show
+ }
+ },
+ actions: {
+ loadHooks (context) {
+ axios.get('/api/registrations/hooks').then(result => {
+ context.commit('setHooks', result.data)
+ })
+ },
+ loadGroupList (context) {
+ axios.get('/api/groups/getList').then(result => {
+ context.commit('setGroupList', result.data)
+ })
+ },
+ setHooks (context, hooks) {
+ axios.post('/api/registrations/hookorder', { ids: hooks.map(x => x.id) }).then(result => {
+ context.commit('setHooks', hooks)
+ })
+ }
+ }
+}