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/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. 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({