From 48e331d3a67127f16b64139c0ffcf54bfe0a9c32 Mon Sep 17 00:00:00 2001 From: varun Date: Fri, 1 Dec 2023 01:27:02 -0500 Subject: [PATCH 1/2] changes in read motor status --- src/controllers/tanksController.js | 4 ++-- src/models/tanks.js | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/controllers/tanksController.js b/src/controllers/tanksController.js index 2ded7afa..a161f5bc 100644 --- a/src/controllers/tanksController.js +++ b/src/controllers/tanksController.js @@ -1486,10 +1486,10 @@ exports.readMotorStatus = async (req, reply) => { // For example, you can update a database or trigger an action const motorInfo = await Tank.findOne({ motor_id: motor_id }); - const motor_stp_status = motorInfo.motor_status + const motor_status = motorInfo.motor_status - reply.send({ status_code: 200, motor_status:motor_stp_status }); + reply.send({ status_code: 200, motor_status:motor_status }); } catch (err) { throw boom.boomify(err); } diff --git a/src/models/tanks.js b/src/models/tanks.js index 66750896..637134a8 100644 --- a/src/models/tanks.js +++ b/src/models/tanks.js @@ -71,6 +71,7 @@ const tanksSchema = new mongoose.Schema({ } }); + const motordataSchema = new mongoose.Schema({ From 95b77c9891559fdaa6656c8d5e0d9ba6a683ff6d Mon Sep 17 00:00:00 2001 From: varun Date: Fri, 1 Dec 2023 01:35:44 -0500 Subject: [PATCH 2/2] user handler password error --- src/handlers/userHandler.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/handlers/userHandler.js b/src/handlers/userHandler.js index 97e82db7..ae23d3c2 100644 --- a/src/handlers/userHandler.js +++ b/src/handlers/userHandler.js @@ -129,6 +129,8 @@ exports.verifyUser = async (req, reply) => { throw boom.boomify(err); } }; + + exports.validatePhoneFormat = async (req, reply) => { try { var user = new User(req.body); @@ -360,6 +362,7 @@ exports.verifyPhone = async (req, reply) => { throw boom.boomify(err); } }; + exports.sendPhoneVerificationCode = async (req, reply) => { // Setting a regError in request so a user is not sent a verificaiton code if registration is not successful // checkign if regError property is available in the req body, if it exists , do not send the message @@ -545,7 +548,7 @@ exports.sendPasswordResetCode = async (req) => { // var authToken = twilioAuthToken; // Your Auth Token from www.twilio.com/console var client = new twilio(twilioAccountSid, twilioAuthToken); // var code = Math.floor(100000 + Math.random() * 900000); - code = user.passwordResetCode.toString(); + //code = user.passwordResetCode.toString(); // Message format to allow app to autopickup sms message and // verify the code.