diff --git a/src/stores/payment/index.ts b/src/stores/payment/index.ts index 1f465d45..9d63f426 100644 --- a/src/stores/payment/index.ts +++ b/src/stores/payment/index.ts @@ -2,7 +2,13 @@ import { ref } from 'vue'; import { defineStore } from 'pinia'; import { api } from 'src/boot/axios'; import { PaginationResult } from 'src/types'; -import { Invoice, InvoicePayload, Payment, Receipt } from './types'; +import { + Invoice, + InvoicePayload, + Payment, + Receipt, + PaymentFlowAccount, +} from './types'; import { manageAttachment } from '../utils'; export const usePayment = defineStore('payment-store', () => { @@ -17,6 +23,15 @@ export const usePayment = defineStore('payment-store', () => { return res.data; } + async function getFlowAccount(id: string) { + const res = await api.get( + `/payment/${id}/flow-account`, + ); + if (res.status >= 400) return null; + console.log(res); + return res.data; + } + async function getPaymentList(opts?: { page?: number; pageSize?: number; @@ -58,6 +73,8 @@ export const usePayment = defineStore('payment-store', () => { updatePayment, deletePayment, + getFlowAccount, + ...manageAttachment(api, 'payment'), }; });