refacotor: delete duplicated variable
gitea/salix/pipeline/head This commit looks good Details

This commit is contained in:
Vicent Llopis 2023-01-09 14:55:25 +01:00
parent 84788afc10
commit e659f0f020
1 changed files with 2 additions and 4 deletions

View File

@ -95,7 +95,7 @@ module.exports = Self => {
], myOptions); ], myOptions);
} }
const invoiceableClients = await getInvoiceableClients(ctx, myOptions); const invoiceableClients = await getInvoiceableClients(ctx, minShipped, myOptions);
if (!invoiceableClients) return; if (!invoiceableClients) return;
@ -145,11 +145,9 @@ module.exports = Self => {
], options); ], options);
} }
async function getInvoiceableClients(ctx, options) { async function getInvoiceableClients(ctx, minShipped, options) {
const models = Self.app.models; const models = Self.app.models;
const args = ctx.args; const args = ctx.args;
const minShipped = new Date();
minShipped.setFullYear(minShipped.getFullYear() - 1);
const query = `SELECT const query = `SELECT
c.id, c.id,