mirror of
				https://github.com/crater-invoice/crater.git
				synced 2025-10-31 13:41:09 -04:00 
			
		
		
		
	
		
			
				
	
	
		
			28 lines
		
	
	
		
			767 B
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
			
		
		
	
	
			28 lines
		
	
	
		
			767 B
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
| import * as types from './mutation-types'
 | |
| 
 | |
| export const submitData = ({ commit, dispatch, state }, data) => {
 | |
|   return new Promise((resolve, reject) => {
 | |
|     window.axios.post('/api/settings/general', data).then((response) => {
 | |
|       // commit(types.SET_CATEGORIES, response.data)
 | |
|       resolve(response)
 | |
|     }).catch((err) => {
 | |
|       reject(err)
 | |
|     })
 | |
|   })
 | |
| }
 | |
| 
 | |
| export const loadData = ({ commit, dispatch, state }) => {
 | |
|   return new Promise((resolve, reject) => {
 | |
|     window.axios.get('/api/settings/general').then((response) => {
 | |
|       commit(types.SET_INITIAL_DATA, response.data)
 | |
|       resolve(response)
 | |
|     }).catch((err) => {
 | |
|       reject(err)
 | |
|     })
 | |
|   })
 | |
| }
 | |
| 
 | |
| export const setItemDiscount = ({ commit, dispatch, state }) => {
 | |
|   commit(types.SET_ITEM_DISCOUNT)
 | |
| }
 |