From eed09b52ca75aa92471fa3da998b9d4aed84fe38 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20S=C3=A1?= Date: Tue, 2 Aug 2022 15:50:48 +0100 Subject: [PATCH] refactor: simplified CSV testing --- lib/new-admin/services/transactions.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/new-admin/services/transactions.js b/lib/new-admin/services/transactions.js index 58983305..5ecf5c05 100644 --- a/lib/new-admin/services/transactions.js +++ b/lib/new-admin/services/transactions.js @@ -141,14 +141,14 @@ function batch ( return Promise.all(promises) .then(packager) - .then(res => { - if (simplified) return simplifiedBatch(res) + .then(res => + !isCsvExport ? res : // GQL transactions and transactionsCsv both use this function and // if we don't check for the correct simplified value, the Transactions page polling // will continuously build a csv in the background - else if (simplified === false) return advancedBatch(res) - return res - }) + simplified ? simplifiedBatch(res) : + advancedBatch(res) + ) } function advancedBatch (data) {