From d3524b538ee70a0b0ce587f71a03ae15f8815515 Mon Sep 17 00:00:00 2001 From: vicwere Date: Tue, 18 Jun 2024 11:31:52 +0300 Subject: [PATCH] Chatbot Log Chatbot Log --- routes/processes/nishauri_new.js | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/routes/processes/nishauri_new.js b/routes/processes/nishauri_new.js index d22c956..ff264c7 100644 --- a/routes/processes/nishauri_new.js +++ b/routes/processes/nishauri_new.js @@ -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); @@ -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,