Skip to content

Commit

Permalink
from nine errors
Browse files Browse the repository at this point in the history
  • Loading branch information
suculent committed Nov 15, 2023
1 parent c0bdb45 commit d81e09d
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 4 deletions.
4 changes: 3 additions & 1 deletion lib/router.transfer.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,11 @@ module.exports = function (app) {

function transferResultRedirect(success, res, response) {

/*
if ((process.env.ENVIRONMENT === "test") || (process.env.ENVIRONMENT === "development")) {
return Util.responder(res, success, response);
}
*/

if (success === false) {
res.redirect(app_config.public_url + "/error.html?success=failed&reason=" + response);
Expand Down Expand Up @@ -44,7 +46,7 @@ module.exports = function (app) {
udids: []
};

await transfer.decline(body).catch((response)=> {
let response = await transfer.decline(body).catch((response)=> {

Check warning on line 49 in lib/router.transfer.js

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

lib/router.transfer.js#L49

Missing space before =>.
transferResultRedirect(false, res, response);
});

Expand Down
8 changes: 6 additions & 2 deletions lib/thinx/transfer.js
Original file line number Diff line number Diff line change
Expand Up @@ -527,9 +527,13 @@ module.exports = class Transfer {

var dtid = "dt:" + transfer_id;

console.log(`🔨 [debug] [transfer] getting DTID ${dtid} on decline`);
let json = await this.redis.get(dtid).catch((e) => {
console.log("[transfer][decline] rejected:", e)

Check notice on line 531 in lib/thinx/transfer.js

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

lib/thinx/transfer.js#L531

Missing semicolon.
Promise.reject(e);
});

const json = await this.redis.get(dtid);
console.log(`🔨 [debug] [transfer] getting DTID ${dtid} on decline`);
console.log("...json:", {json});

let json_keys = JSON.parse(json);

Expand Down
3 changes: 2 additions & 1 deletion spec/jasmine/TransferSpec.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,8 @@ describe("Transfer", function () {
let response = await transfer.request(owner, body);

expect(response).to.be.a('string');
const tbody = {

let tbody = {
transfer_id: response.replace("dt:", ""),
udids: [envi.udid]
};
Expand Down

0 comments on commit d81e09d

Please sign in to comment.