import { ActionTree } from 'vuex' ; import { StateInterface } from '../index' ; import { InvoiceQuotationStateInterface } from './state' ; import { api as $http } from '../../boot/axios' ; import { HttpError , HttpResponse , InvoiceQuotationType } from '../../types' ; const actions = { async FETCH_CURRENTLY_VIEWED_INVOICE_QUOTATION ( { commit } , { id , type } ) { return new Promise ( async ( resolve ) => { await $http . get ( `print-pages/print-invoices-quotations/${ id }/${ type }` ) . then ( ( res ) => { commit ( 'SET_CURRENTLY_VIEWED_INVOICE_QUOTATION' , res . data . data ) ; resolve ( res . data ) ; } ) . catch ( ( error ) => { console . log ( { status : error . response ?. status , statusText : error . response ?. statusText , } ) ; } ) ; } ) ; } , } ; export default actions ;