diff --git a/service/cards.js b/service/cards.js index 1edef05..ac5103c 100644 --- a/service/cards.js +++ b/service/cards.js @@ -58,14 +58,18 @@ var cards = { country: result.rows[0].country, }, }, + }).then((cardholder)=>{ + + console.log(cardholder); + let resultItem = { + "result": cardholder, + "total_record": 0 + } + next(null, resultItem); // pass control to the next handler + }); - console.log(cardholder); - let resultItem = { - "result": cardholder, - "total_record": 0 - } - next(null, resultItem); // pass control to the next handler + } catch (e) { next(e.message, null); // pass control to the next handler }