mirror of
				https://github.com/crater-invoice/crater.git
				synced 2025-11-03 22:13:18 -05:00 
			
		
		
		
	
		
			
				
	
	
		
			16 lines
		
	
	
		
			432 B
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
			
		
		
	
	
			16 lines
		
	
	
		
			432 B
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
import * as types from './mutation-types'
 | 
						|
 | 
						|
export const fetchEstimateTemplates = ({ commit, dispatch, state }, params) => {
 | 
						|
  return new Promise((resolve, reject) => {
 | 
						|
    window.axios
 | 
						|
      .get(`/api/v1/estimates/templates`, { params })
 | 
						|
      .then((response) => {
 | 
						|
        commit(types.SET_ESTIMATE_TEMPLATES, response.data.templates)
 | 
						|
        resolve(response)
 | 
						|
      })
 | 
						|
      .catch((err) => {
 | 
						|
        reject(err)
 | 
						|
      })
 | 
						|
  })
 | 
						|
}
 |