From 499a3297c2faefe5c83d5bc5bccd55a9dfdaa691 Mon Sep 17 00:00:00 2001 From: Matej Sychra Date: Wed, 15 Nov 2023 14:33:11 +0100 Subject: [PATCH] refactoring transfer to async --- lib/router.transfer.js | 4 ++-- lib/thinx/transfer.js | 5 +++-- spec/jasmine/TransferSpec.js | 10 +++++----- 3 files changed, 10 insertions(+), 9 deletions(-) diff --git a/lib/router.transfer.js b/lib/router.transfer.js index 053159899..eab5b020f 100644 --- a/lib/router.transfer.js +++ b/lib/router.transfer.js @@ -24,10 +24,10 @@ module.exports = function (app) { } } - function requestTransfer(req, res) { + async function requestTransfer(req, res) { if (!Util.validateSession(req)) return res.status(401).end(); let owner = sanitka.owner(req.session.owner); - transfer.request(owner, req.body, (success, response) => { + await transfer.request(owner, req.body, (success, response) => { transferResultRedirect(success, res, response); }); } diff --git a/lib/thinx/transfer.js b/lib/thinx/transfer.js index 98439a7a8..2c5023c39 100644 --- a/lib/thinx/transfer.js +++ b/lib/thinx/transfer.js @@ -266,7 +266,7 @@ module.exports = class Transfer { sendRecipientTransferEmail(body, transfer_uuid) { - if (!Util.isDefined(body.udids)) { console.log("[error] [sendRecipientTransferEmail] missing body.udids"); return } + if (!Util.isDefined(body.udids)) { console.log("[error] [sendRecipientTransferEmail] missing body.udids"); return; } var htmlDeviceList = "