feat: add date range parameters to quotation and payment report APIs

This commit is contained in:
puriphatt 2025-03-06 13:26:50 +07:00
parent cf7b1ac1de
commit 051221e324
2 changed files with 12 additions and 4 deletions

View file

@ -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;
}

View file

@ -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;
}