0
1
Fork 0

fix(invoices): Refactorización del manejo de fechas en la función fetchInvoices

- Se actualizó la función fetchInvoices para desestructurar los parámetros de fecha de un objeto y mejorar la legibilidad.
This commit is contained in:
Guido 2025-04-01 11:39:31 -03:00
parent 5881f12306
commit 4ef5e8f97b
1 changed files with 2 additions and 3 deletions
src/pages/Ecomerce

View File

@ -52,7 +52,7 @@ const columns = computed(() => [
]);
const fetchInvoices = async clientFk => {
const params = {
const { from, to } = {
from: new Date(currentYear.value, 0),
to: new Date(currentYear.value, 11, 31, 23, 59, 59)
};
@ -60,7 +60,7 @@ const fetchInvoices = async clientFk => {
where: {
clientFk,
issued: {
between: [params.from, params.to]
between: [from, to]
}
},
order: ['issued DESC'],
@ -73,7 +73,6 @@ const fetchInvoices = async clientFk => {
filter: JSON.stringify(filter)
}
});
invoices.value = data;
};