forked from verdnatura/hedera-web
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:
parent
5881f12306
commit
4ef5e8f97b
src/pages/Ecomerce
|
@ -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;
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in New Issue