From fd04a1d0559307c33327628df4d4e3afdc0900e5 Mon Sep 17 00:00:00 2001 From: Iain Sproat <68657+iainsproat@users.noreply.github.com> Date: Thu, 13 Jul 2023 21:18:51 +0100 Subject: [PATCH] fix(fileimport): destructuring for...of should use entries() (#1704) --- packages/fileimport-service/ifc/api.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/fileimport-service/ifc/api.js b/packages/fileimport-service/ifc/api.js index e10c8ae12..392590a92 100644 --- a/packages/fileimport-service/ifc/api.js +++ b/packages/fileimport-service/ifc/api.js @@ -123,7 +123,7 @@ module.exports = class ServerAPI { // step 1: insert objects if (objsToInsert.length > 0) { const batches = chunk(objsToInsert, objectsBatchSize) - for (const [index, batch] of batches) { + for (const [index, batch] of batches.entries()) { this.prepInsertionObjectBatch(batch) await knex.transaction(async (trx) => { const q = Objects().insert(batch).toString() + ' on conflict do nothing' @@ -141,7 +141,7 @@ module.exports = class ServerAPI { if (closures.length > 0) { const batches = chunk(closures, closureBatchSize) - for (const [index, batch] of batches) { + for (const [index, batch] of batches.entries()) { this.prepInsertionClosureBatch(batch) await knex.transaction(async (trx) => { const q = Closures().insert(batch).toString() + ' on conflict do nothing'