Skip to content

Commit

Permalink
Chatbot Log
Browse files Browse the repository at this point in the history
Chatbot Log
  • Loading branch information
vicwere committed Jun 18, 2024
1 parent e55d030 commit d3524b5
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions routes/processes/nishauri_new.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,9 @@ const { NReviews } = require("../../models/n_reviews");
const { NprogramOTP } = require("../../models/n_program_otp");
const { NToken } = require("../../models/n_revoke_token");

const { NChatLogs } = require("../../models/n_chat_log");


generateOtp = function (size) {
const zeros = "0".repeat(size - 1);
const x = parseFloat("1" + zeros);
Expand Down Expand Up @@ -2316,12 +2319,20 @@ router.post(
}
//var obj_ = body;
//console.log(body);

var log_activity_ = NLogs.create({
user_id: base64.decode(userid),
access: "CHAT"
});

var obj = JSON.parse(body);

var log_chat = NChatLogs.create({
user_id: base64.decode(userid),
quiz:question_,
response: obj.response
});

return res.status(200).json({
success: true,
msg: obj.response,
Expand Down

0 comments on commit d3524b5

Please sign in to comment.