Skip to content

Commit

Permalink
still no pass towards deleting dtid
Browse files Browse the repository at this point in the history
  • Loading branch information
suculent committed Nov 16, 2023
1 parent 76a375b commit 287aabc
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
12 changes: 7 additions & 5 deletions lib/router.transfer.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,20 +29,22 @@ module.exports = function (app) {
}
}

// Premise: This happens from E-mail! How does it even look like? WTH is the UI!?
async function requestTransfer(req, res) {

if (!Util.validateSession(req)) return res.status(401).end();
if (!Util.validateSession(req)) return res.status(401).end(); // should happen in all requests by default. does it?

let owner = sanitka.owner(req.session.owner);
const body = req.body;

return await transfer.request(owner, body).catch( (error) => {
let response = await transfer.request(owner, body).catch( (error) => {
console.log("[requestTransfer] await transfer.request with error", error.message, "with body", {body});
transferResultRedirect(false, res, error);
}).then((value) => {
console.log("[requestTransfer] then()...", value);
transferResultRedirect(true, res);
});

console.log("[requestTransfer] then()...", response);
transferResultRedirect(true, res);

}

async function getDeclineTransfer(req, res) {
Expand Down
4 changes: 2 additions & 2 deletions lib/thinx/transfer.js
Original file line number Diff line number Diff line change
Expand Up @@ -510,7 +510,7 @@ module.exports = class Transfer {

Promise.all(promises).then(async () => {
await this.updateOrDeleteDTIDWithCallback(dtid, json_keys);
return Promise.resolve(true);
return Promise.resolve(dtid);
}).catch(e => console.log("[transfer] promise exception", e));
}

Expand Down Expand Up @@ -619,7 +619,7 @@ module.exports = class Transfer {
// Store remaining (not declined) keys
await this.updateOrDeleteDTID(dtid, json_keys);

return Promise.resolve(true);
return Promise.resolve(dtid);
}

};

0 comments on commit 287aabc

Please sign in to comment.