fixing callback function on server side

This commit is contained in:
mati108@gmail.com committed 2018-09-18 12:25:56 -03:00
1 parent 67a74b88c6
commit 565f072dd1
2 files changed
+36 -22

No files matched your search

+11 -3
View File
@@ -739,6 +739,11 @@ function onBrowserRequest(request, response) {
global.EXCHANGE_NAME = "Poloniex";
global.MARKET = {
assetA: "USDT",
assetB: "BTC"
};
global.EXCHANGE_KEYS = {
"Poloniex": {
"Key": exchangeKey,
@@ -814,12 +819,15 @@ function onBrowserRequest(request, response) {
}
}
function onExchangeResponse(exchangeResponse) {
function onExchangeResponse(err, exchangeResponse) {
/* Delete these secrets before they get logged. */
requestParameters[3] = "";
respondWithContent(JSON.stringify(exchangeResponse), response);
requestParameters[3] = "";
if (err.result === global.DEFAULT_OK_RESPONSE.result)
respondWithContent(JSON.stringify(exchangeResponse), response);
else
respondWithContent(JSON.stringify(err), response);
}
return;