test ng customerid in user

master
varun 3 years ago
parent fd1c6b32eb
commit 08e5c6355f

@ -9,7 +9,9 @@ const libphonenumberjs = require("libphonenumber-js");
const boom = require("boom"); const boom = require("boom");
// Get Data Models // Get Data Models
const User = require("../models/User"); //const User = require("../models/User");
const { User, Counter,Test } = require('../models/User');
const customJwtAuth = require("../customAuthJwt"); const customJwtAuth = require("../customAuthJwt");
const fastify = require("fastify")({ const fastify = require("fastify")({
logger: true, logger: true,
@ -156,8 +158,10 @@ exports.editCuurentUserInfo = async (req, reply) => {
// Function accepts username, password , encrypts password and saves it in the database. // Function accepts username, password , encrypts password and saves it in the database.
exports.addUser = async (req, reply) => { exports.addUser = async (req, reply) => {
try { try {
// console.log("This is the reply in the handler after the validations", reply); // console.log("This is the reply in the handler after the validations", reply);
userData = { userData = {
username: req.body.username, username: req.body.username,
emails: req.body.emails, emails: req.body.emails,
password: req.body.password, password: req.body.password,
@ -175,7 +179,7 @@ exports.addUser = async (req, reply) => {
notes: req.body.notes, notes: req.body.notes,
}, },
}; };
console.log(counter.seq)
var user = new User(userData); var user = new User(userData);
//password is not at the top level in the collection. //password is not at the top level in the collection.
@ -187,6 +191,7 @@ exports.addUser = async (req, reply) => {
if (checkFormEncoding.isUserFormUrlEncoded) { if (checkFormEncoding.isUserFormUrlEncoded) {
usertobeInserted = checkFormEncoding.user; usertobeInserted = checkFormEncoding.user;
console.log("thsi true url string"); console.log("thsi true url string");
user.username = usertobeInserted.username; user.username = usertobeInserted.username;
user.firstName = usertobeInserted.firstName; user.firstName = usertobeInserted.firstName;
user.lastName = usertobeInserted.lastName; user.lastName = usertobeInserted.lastName;

Loading…
Cancel
Save