diff --git a/web/src/store.js b/web/src/store.js index c2986ad..71d7df8 100644 --- a/web/src/store.js +++ b/web/src/store.js @@ -460,6 +460,12 @@ const store = createStore({ if (data && success) { commit('setShippingCodes', data); } + }, + async createShippingCode({commit, state}, code) { + const {data, success} = await http.post('/2/shipping_codes/', {code}, 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 e82f8ed..b38de80 100644 --- a/web/src/views/admin/Shipping.vue +++ b/web/src/views/admin/Shipping.vue @@ -1,22 +1,48 @@ - - - - - - use - - - - delete + + Shipping Codes + + + + + + use + + + + delete + + + + + + + + + + 2kg DE + 2kg EU + 5kg DE + 5kg EU + 10kg DE + + + + + Bulk + + + + + {{ (bulk ? "Add Shipping Codes" : "Add Shipping Code") }} - - + +