diff --git a/web/src/store.js b/web/src/store.js index 44e972f..48fc609 100644 --- a/web/src/store.js +++ b/web/src/store.js @@ -20,7 +20,8 @@ const store = createStore({ groups: [], state_options: [], messageTemplates: [], - messageTemplatesVariables: [], + messageTemplateVariables: [], + shippingCodes: null, lastEvent: '37C3', lastUsed: {}, @@ -209,6 +210,9 @@ const store = createStore({ setMessageTemplateVariables(state, variables) { state.messageTemplateVariables = variables; }, + setShippingCodes(state, codes) { + state.shippingCodes = codes; + }, }, actions: { async login({commit}, {username, password, remember}) { @@ -450,6 +454,12 @@ const store = createStore({ if (data && success) { commit('setMessageTemplates', data); } + }, + async fetchShippingCodes({commit, state}) { + const {data, success} = await http.get('/2/shipping_codes/', state.user.token); + if (data && success) { + commit('setShippingCodes', data); + } } }, plugins: [ diff --git a/web/src/views/admin/Shipping.vue b/web/src/views/admin/Shipping.vue index 6471233..e82f8ed 100644 --- a/web/src/views/admin/Shipping.vue +++ b/web/src/views/admin/Shipping.vue @@ -1,12 +1,12 @@