chore: fix filtering bug

This commit is contained in:
Anthony Potdevin 2019-12-23 20:14:09 +05:30
parent c5179274ef
commit cef7a65ea5

View file

@ -97,11 +97,12 @@ export const getResume = {
new Date(lastInvoiceDate),
new Date(payment.date),
) === 1;
const first =
compareDesc(
new Date(payment.date),
new Date(firstInvoiceDate),
) === 1;
const first = params.token
? compareDesc(
new Date(payment.date),
new Date(firstInvoiceDate),
) === 1
: true;
return last && first;
})
: payments;