|
@@ -42,7 +42,7 @@ const actions = {
|
|
|
* @param {*} param0
|
|
|
* @param {*} payload
|
|
|
*/
|
|
|
- createSupplier({ commit }, payload) {
|
|
|
+ createSupplier({ commit, dispatch }, payload) {
|
|
|
const data = {
|
|
|
jsonrpc: '2.0',
|
|
|
method: 'call',
|
|
@@ -52,7 +52,7 @@ const actions = {
|
|
|
}
|
|
|
|
|
|
return axios.post(createSupplierUrl, data).then(response => {
|
|
|
- console.log(response)
|
|
|
+ dispatch('addSupplier', response.data.result)
|
|
|
}).catch(error => {
|
|
|
console.log(error)
|
|
|
})
|
|
@@ -69,7 +69,7 @@ const actions = {
|
|
|
* @param {*} param0
|
|
|
* @param {*} payload
|
|
|
*/
|
|
|
- createProduct({ commit }, payload) {
|
|
|
+ createProduct({ commit, dispatch }, payload) {
|
|
|
const data = {
|
|
|
jsonrpc: '2.0',
|
|
|
method: 'call',
|
|
@@ -79,7 +79,7 @@ const actions = {
|
|
|
}
|
|
|
|
|
|
return axios.post(createProductUrl, data).then(response => {
|
|
|
- console.log(response)
|
|
|
+ dispatch('addProduct', response.data.result)
|
|
|
}).catch(error => {
|
|
|
console.log(error)
|
|
|
})
|