feat: function api get flow account of payment
This commit is contained in:
parent
e8cd7e2df8
commit
201ddfdcfa
1 changed files with 18 additions and 1 deletions
|
|
@ -2,7 +2,13 @@ import { ref } from 'vue';
|
||||||
import { defineStore } from 'pinia';
|
import { defineStore } from 'pinia';
|
||||||
import { api } from 'src/boot/axios';
|
import { api } from 'src/boot/axios';
|
||||||
import { PaginationResult } from 'src/types';
|
import { PaginationResult } from 'src/types';
|
||||||
import { Invoice, InvoicePayload, Payment, Receipt } from './types';
|
import {
|
||||||
|
Invoice,
|
||||||
|
InvoicePayload,
|
||||||
|
Payment,
|
||||||
|
Receipt,
|
||||||
|
PaymentFlowAccount,
|
||||||
|
} from './types';
|
||||||
import { manageAttachment } from '../utils';
|
import { manageAttachment } from '../utils';
|
||||||
|
|
||||||
export const usePayment = defineStore('payment-store', () => {
|
export const usePayment = defineStore('payment-store', () => {
|
||||||
|
|
@ -17,6 +23,15 @@ export const usePayment = defineStore('payment-store', () => {
|
||||||
return res.data;
|
return res.data;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async function getFlowAccount(id: string) {
|
||||||
|
const res = await api.get<PaymentFlowAccount>(
|
||||||
|
`/payment/${id}/flow-account`,
|
||||||
|
);
|
||||||
|
if (res.status >= 400) return null;
|
||||||
|
console.log(res);
|
||||||
|
return res.data;
|
||||||
|
}
|
||||||
|
|
||||||
async function getPaymentList(opts?: {
|
async function getPaymentList(opts?: {
|
||||||
page?: number;
|
page?: number;
|
||||||
pageSize?: number;
|
pageSize?: number;
|
||||||
|
|
@ -58,6 +73,8 @@ export const usePayment = defineStore('payment-store', () => {
|
||||||
updatePayment,
|
updatePayment,
|
||||||
deletePayment,
|
deletePayment,
|
||||||
|
|
||||||
|
getFlowAccount,
|
||||||
|
|
||||||
...manageAttachment(api, 'payment'),
|
...manageAttachment(api, 'payment'),
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue