From b790ee88d941f1c9b77dc8e980e795c12a45d209 Mon Sep 17 00:00:00 2001 From: joan Date: Fri, 3 Jun 2022 12:57:39 +0200 Subject: [PATCH] Edi fixes --- back/methods/edi/updateData.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/back/methods/edi/updateData.js b/back/methods/edi/updateData.js index b3b52e060..b40a4f2c5 100644 --- a/back/methods/edi/updateData.js +++ b/back/methods/edi/updateData.js @@ -102,13 +102,14 @@ module.exports = Self => { const toTable = file.toTable; const baseName = file.fileName; - const tableName = `edi.${toTable}`; - await Self.rawSql(`DELETE FROM ??`, [tableName], options); - const tx = await Self.beginTransaction({}); + try { const options = {transaction: tx}; + const tableName = `edi.${toTable}`; + await Self.rawSql(`DELETE FROM ??`, [tableName], options); + for (const zipEntry of entries) { const entryName = zipEntry.entryName; console.log(`Reading file ${entryName}...`);