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,
|
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;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -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;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue