Files
crater/public/build/assets/payment.e5b74251.js
Mohit Panjwani 18507ddb6f new build 606
2022-03-06 12:39:21 +05:30

2 lines
933 B
JavaScript

import{h as s}from"./auth.c88ceb4c.js";import{a as o}from"./vendor.d12b5734.js";const{defineStore:c}=window.pinia,r=c({id:"customerPaymentStore",state:()=>({payments:[],selectedViewPayment:[],totalPayments:0}),actions:{fetchPayments(e,a){return new Promise((n,m)=>{o.get(`/api/v1/${a}/customer/payments`,{params:e}).then(t=>{this.payments=t.data.data,this.totalPayments=t.data.meta.paymentTotalCount,n(t)}).catch(t=>{s(t),m(t)})})},fetchViewPayment(e,a){return new Promise((n,m)=>{o.get(`/api/v1/${a}/customer/payments/${e.id}`).then(t=>{this.selectedViewPayment=t.data.data,n(t)}).catch(t=>{s(t),m(t)})})},searchPayment(e,a){return new Promise((n,m)=>{o.get(`/api/v1/${a}/customer/payments`,{params:e}).then(t=>{this.payments=t.data,n(t)}).catch(t=>{s(t),m(t)})})},fetchPaymentModes(e,a){return new Promise((n,m)=>{o.get(`/api/v1/${a}/customer/payment-method`,{params:e}).then(t=>{n(t)}).catch(t=>{s(t),m(t)})})}}});export{r as u};