Skip to content

Commit

Permalink
test callback and show result of callback
Browse files Browse the repository at this point in the history
  • Loading branch information
lathoub committed Feb 12, 2025
1 parent d8c9378 commit ac42244
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
7 changes: 6 additions & 1 deletion src/controllers/processes/callback.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,15 @@ export function post(req, res) {
}

var jobId = req.params.jobId;
var typeResult = req.query.type

var formatFreeUrl = utils.getFormatFreeUrl(req);

var accept = accepts(req);
var format = accept.type(["json"]);

console.log(
`call received from jobID: ${jobId}, type is '${req.query.type}'`
`call received from jobID: ${jobId}, type is '${typeResult}'`
);

callback.post(formatFreeUrl, jobId, req.query, function (err, content) {
Expand All @@ -36,6 +37,10 @@ export function post(req, res) {
return;
}

console.log(
`result '${JSON.stringify(content)}'`
);

switch (format) {
case "json":
res.status(200).json(content);
Expand Down
2 changes: 1 addition & 1 deletion src/models/processes/callback.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ function post(neutralUrl, jobId, query, callback) {
}
*/

let content = {};
let content = job.results;
callback(undefined, content);
}

Expand Down

0 comments on commit ac42244

Please sign in to comment.