From 8b5f5d928e0cb592f39de52e4816696b2abd88e7 Mon Sep 17 00:00:00 2001 From: vicent Date: Tue, 20 Dec 2022 10:40:39 +0100 Subject: [PATCH] fix: backTest --- modules/invoiceOut/back/methods/invoiceOut/downloadZip.js | 2 +- .../back/methods/invoiceOut/specs/downloadZip.spec.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/invoiceOut/back/methods/invoiceOut/downloadZip.js b/modules/invoiceOut/back/methods/invoiceOut/downloadZip.js index aec209657..fe005f1ab 100644 --- a/modules/invoiceOut/back/methods/invoiceOut/downloadZip.js +++ b/modules/invoiceOut/back/methods/invoiceOut/downloadZip.js @@ -37,12 +37,12 @@ module.exports = Self => { Self.downloadZip = async function(ctx, ids, options) { const models = Self.app.models; const myOptions = {}; - const zipConfig = await models.ZipConfig.findOne(null, myOptions); const zip = new JSZip(); if (typeof options == 'object') Object.assign(myOptions, options); + const zipConfig = await models.ZipConfig.findOne(null, myOptions); let totalSize = 0; ids = ids.split(','); diff --git a/modules/invoiceOut/back/methods/invoiceOut/specs/downloadZip.spec.js b/modules/invoiceOut/back/methods/invoiceOut/specs/downloadZip.spec.js index e458ad9ff..4d1833635 100644 --- a/modules/invoiceOut/back/methods/invoiceOut/specs/downloadZip.spec.js +++ b/modules/invoiceOut/back/methods/invoiceOut/specs/downloadZip.spec.js @@ -3,7 +3,7 @@ const UserError = require('vn-loopback/util/user-error'); describe('InvoiceOut downloadZip()', () => { const userId = 9; - const invoiceIds = [1, 2]; + const invoiceIds = '1,2'; const ctx = { req: {