actions.js 531 B

1234567891011121314151617181920212223
  1. const actions = {
  2. notify({ commit }, payload) {
  3. openerp.web.notification.do_warn('Atención', payload)
  4. },
  5. fetchData({ dispatch }) {
  6. let promises = [
  7. dispatch('fetchCompany'),
  8. dispatch('fetchCurrencies'),
  9. dispatch('fetchProducts'),
  10. dispatch('fetchCustomers')
  11. ]
  12. Promise.all(promises).then(() => {
  13. console.log('loaded')
  14. }).catch(error => {
  15. console.log(error)
  16. })
  17. }
  18. }
  19. export default {
  20. actions
  21. }