ashok 2 years ago
commit 834f2ebab3

@ -1486,10 +1486,10 @@ exports.readMotorStatus = async (req, reply) => {
// For example, you can update a database or trigger an action // For example, you can update a database or trigger an action
const motorInfo = await Tank.findOne({ motor_id: motor_id }); 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) { } catch (err) {
throw boom.boomify(err); throw boom.boomify(err);
} }

@ -129,6 +129,8 @@ exports.verifyUser = async (req, reply) => {
throw boom.boomify(err); throw boom.boomify(err);
} }
}; };
exports.validatePhoneFormat = async (req, reply) => { exports.validatePhoneFormat = async (req, reply) => {
try { try {
var user = new User(req.body); var user = new User(req.body);
@ -360,6 +362,7 @@ exports.verifyPhone = async (req, reply) => {
throw boom.boomify(err); throw boom.boomify(err);
} }
}; };
exports.sendPhoneVerificationCode = async (req, reply) => { exports.sendPhoneVerificationCode = async (req, reply) => {
// Setting a regError in request so a user is not sent a verificaiton code if registration is not successful // 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 // 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 authToken = twilioAuthToken; // Your Auth Token from www.twilio.com/console
var client = new twilio(twilioAccountSid, twilioAuthToken); var client = new twilio(twilioAccountSid, twilioAuthToken);
// var code = Math.floor(100000 + Math.random() * 900000); // 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 // Message format to allow app to autopickup sms message and
// verify the code. // verify the code.

@ -71,6 +71,7 @@ const tanksSchema = new mongoose.Schema({
} }
}); });
const motordataSchema = new mongoose.Schema({ const motordataSchema = new mongoose.Schema({

Loading…
Cancel
Save