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, canceled: 0,
}); });
async function getQuotationStats() { async function getQuotationStats(params?: {
const res = await api.get<QuotationStats>('/quotation/stats'); startDate: string | Date;
endDate: string | Date;
}) {
const res = await api.get<QuotationStats>('/quotation/stats', { params });
if (res.status < 400) { if (res.status < 400) {
return res.data; return res.data;
} }

View file

@ -98,8 +98,13 @@ export async function getReportProduct() {
return null; return null;
} }
export async function getReportPayment() { export async function getReportPayment(params?: {
const res = await api.get<ReportPayment[]>(`/${ENDPOINT}/payment`); startDate: string | Date;
endDate: string | Date;
}) {
const res = await api.get<ReportPayment[]>(`/${ENDPOINT}/payment`, {
params,
});
if (res.status < 400) { if (res.status < 400) {
return res.data; return res.data;
} }