1234567891011121314151617181920212223242526272829303132333435363738394041424344 |
- import axios from 'axios'
- import { INIT_SALE_URL, CREATE_CUSTOMER_URL, PROCESS_SALE_URL } from '@/constants/resourcePaths'
- const actions = {
- /**
- *
- * @param {*} param0
- * @param {*} payload
- */
- notify({ commit }, payload) {
- openerp.web.notification.do_warn('Atención', payload)
- return false
- },
- /**
- *
- * @param {*} param0
- */
- initSale({ dispatch }) {
- return axios.get(INIT_SALE_URL).then(response => {
- dispatch('explodeData', response.data)
- }).catch(error => {
- console.log(error)
- })
- },
- /**
- *
- * @param {*} param0
- * @param {*} payload
- */
- explodeData({ dispatch }, payload) {
- for (let value in payload) {
- dispatch(`INIT_${value.split(/(?=[A-Z])/).join('_').toUpperCase()}`, payload[value])
- }
- },
- /**
- *
- * @param {*} param0
- */
- createSale({ getters , dispatch }) {
- }
- }
- export default actions
|