From 39ce06d180ea18e509701c9e215c82816bdd4e6d Mon Sep 17 00:00:00 2001 From: jedi Date: Sat, 15 Jun 2024 19:13:03 +0200 Subject: [PATCH] stash --- web/src/store.js | 6 +++ web/src/views/admin/Shipping.vue | 81 +++++++++++++++++++++++++------- 2 files changed, 70 insertions(+), 17 deletions(-) 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 @@