mirror of
				https://github.com/crater-invoice/crater.git
				synced 2025-10-31 05:31:10 -04:00 
			
		
		
		
	fix invoice getter
This commit is contained in:
		| @ -122,7 +122,7 @@ export const updateInvoice = ({ commit, dispatch, state }, data) => { | ||||
| export const markAsSent = ({ commit, dispatch, state }, data) => { | ||||
|   return new Promise((resolve, reject) => { | ||||
|     window.axios.post(`/api/invoices/mark-as-sent`, data).then((response) => { | ||||
|       // commit(types.UPDATE_INVOICE, response.data) | ||||
|       commit(types.UPDATE_INVOICE_STATUS, {id: data.id, status: 'SENT'}) | ||||
|       resolve(response) | ||||
|     }).catch((err) => { | ||||
|       reject(err) | ||||
|  | ||||
| @ -4,3 +4,7 @@ export const getTemplateId = (state) => state.invoiceTemplateId | ||||
| export const selectedInvoices = (state) => state.selectedInvoices | ||||
| export const totalInvoices = (state) => state.totalInvoices | ||||
| export const selectedCustomer = (state) => state.selectedCustomer | ||||
| export const getInvoice = (state) => (id) => { | ||||
|   let invId = parseInt(id) | ||||
|   return state.invoices.find(invoice => invoice.id === invId) | ||||
| } | ||||
|  | ||||
		Reference in New Issue
	
	Block a user