feat: add date range parameters to quotation and payment report APIs
This commit is contained in:
parent
cf7b1ac1de
commit
051221e324
2 changed files with 12 additions and 4 deletions
|
|
@ -32,8 +32,11 @@ export const useQuotationStore = defineStore('quotation-store', () => {
|
|||
canceled: 0,
|
||||
});
|
||||
|
||||
async function getQuotationStats() {
|
||||
const res = await api.get<QuotationStats>('/quotation/stats');
|
||||
async function getQuotationStats(params?: {
|
||||
startDate: string | Date;
|
||||
endDate: string | Date;
|
||||
}) {
|
||||
const res = await api.get<QuotationStats>('/quotation/stats', { params });
|
||||
if (res.status < 400) {
|
||||
return res.data;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -98,8 +98,13 @@ export async function getReportProduct() {
|
|||
return null;
|
||||
}
|
||||
|
||||
export async function getReportPayment() {
|
||||
const res = await api.get<ReportPayment[]>(`/${ENDPOINT}/payment`);
|
||||
export async function getReportPayment(params?: {
|
||||
startDate: string | Date;
|
||||
endDate: string | Date;
|
||||
}) {
|
||||
const res = await api.get<ReportPayment[]>(`/${ENDPOINT}/payment`, {
|
||||
params,
|
||||
});
|
||||
if (res.status < 400) {
|
||||
return res.data;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue