Skip to content

Commit ebbf727

Browse files
authored
Merge pull request #1714 from narendran1560/topic-performance
C50-594 Create a GET api to retrieve the BOT output history based on …
2 parents d5b012b + 1e3c0b0 commit ebbf727

2 files changed

Lines changed: 21 additions & 0 deletions

File tree

server/app/routes/v1.0/routes_bot.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,17 @@ module.exports.setRoutes = function(app, sessionVerificationFunc) {
3434
});
3535
});
3636

37+
app.get('/bot/history/:actionLogId',function(req,res) {
38+
const actionLogId = req.params.actionLogId;
39+
botService.getBotHistoryAudit(actionLogId, function(err, data) {
40+
if (err) {
41+
return res.status(500).send(err);
42+
} else {
43+
return res.status(200).send(data);
44+
}
45+
});
46+
});
47+
3748
app.post('/bot/history',function(req,res) {
3849
const loggedUser = req.session.user.cn;
3950
const rqObj = req.body;

server/app/services/botService.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1538,3 +1538,13 @@ botService.insertBotHistoryAudit = function insertBotHistoryAudit(objList, userN
15381538
};
15391539
});
15401540
};
1541+
1542+
botService.getBotHistoryAudit = function getBotHistoryAudit(actionLogId, callback) {
1543+
botHistoryAuditTrail.findOneByQuery({ actionLogId : actionLogId }, {}, {}, (err, status) => {
1544+
if(err) {
1545+
callback(err, null);
1546+
} else {
1547+
callback(null, status);
1548+
};
1549+
});
1550+
};

0 commit comments

Comments
 (0)