master
Naidu 1 year ago
parent 9c489537bc
commit d20763408a

@ -16,6 +16,8 @@ exports.installSignUp = async (request, reply) => {
//name, //name,
phone, phone,
address, address,
address1,
address2,
installationId, installationId,
emails, emails,
password, password,
@ -28,6 +30,7 @@ exports.installSignUp = async (request, reply) => {
alternativeNumber, alternativeNumber,
firstName, firstName,
lastName, lastName,
city,
createdBy, createdBy,
updatedBy, updatedBy,
} = request.body; } = request.body;
@ -51,7 +54,9 @@ exports.installSignUp = async (request, reply) => {
const install = new Install({ const install = new Install({
//name, //name,
phone, phone,
address, address,
address1,
address2,
installationId, installationId,
emails, emails,
services: { password: { bcrypt: hashedPassword } }, services: { password: { bcrypt: hashedPassword } },
@ -64,6 +69,7 @@ exports.installSignUp = async (request, reply) => {
alternativeNumber, alternativeNumber,
firstName, firstName,
lastName, lastName,
city,
createdBy, createdBy,
updatedBy, updatedBy,

@ -279,9 +279,9 @@ fastify.post("/api/login", {
fastify.post("/api/installotplogin", { fastify.post("/api/installotplogin", {
schema: { schema: {
description: "This is for Login Otp Boy", description: "This is for Login Otp Installation",
tags: ["Install"], tags: ["Install"],
summary: "This is for Login Otp Boy", summary: "This is for Login Otp Installation",
body: { body: {
type: "object", type: "object",
required: ["phone", "phoneVerificationCode"], required: ["phone", "phoneVerificationCode"],
@ -340,7 +340,7 @@ fastify.post("/api/installotplogin", {
} else { } else {
const token = fastify.jwt.sign( const token = fastify.jwt.sign(
{ {
name: user.name, firstName: user.firstName,
}, },
{ expiresIn: "30d" } { expiresIn: "30d" }
); );
@ -348,7 +348,7 @@ fastify.post("/api/installotplogin", {
const profilePicture = await ProfilePictureInstall.findOne({ const profilePicture = await ProfilePictureInstall.findOne({
customerId: user._id, customerId: user._id,
}); });
console.log(user)
const responsePayload = { const responsePayload = {
simplydata: { simplydata: {
error: false, error: false,
@ -356,9 +356,9 @@ fastify.post("/api/installotplogin", {
access_token: token, access_token: token,
email: user.emails, email: user.emails,
phone: user.phone, phone: user.phone,
name: user.name, //name: user.name,
address1: user.profile.address1, address1: user.address1,
address2: user.profile.address2, address2: user.address2,
phoneVerified: user.phoneVerified, phoneVerified: user.phoneVerified,
oneTimePasswordSetFlag: user.oneTimePasswordSetFlag, oneTimePasswordSetFlag: user.oneTimePasswordSetFlag,
type: user.profile.role, type: user.profile.role,
@ -368,6 +368,7 @@ fastify.post("/api/installotplogin", {
manager: user.manager, manager: user.manager,
firstName: user.firstName, firstName: user.firstName,
lastName: user.lastName, lastName: user.lastName,
address: user.address,
alternativeNumber: user.alternativeNumber, alternativeNumber: user.alternativeNumber,
}, },
}; };

@ -15,14 +15,14 @@ const installationschema = new mongoose.Schema({
oneTimePasswordSetFlag: { type: Boolean, default: false }, oneTimePasswordSetFlag: { type: Boolean, default: false },
emails: [{ email: String, verified: { type: Boolean, default: false } }], emails: [{ email: String, verified: { type: Boolean, default: false } }],
services: { password: { bcrypt: String } }, services: { password: { bcrypt: String } },
alternativeNumber: { type: String, default: null },
firstName: { type: String, default: null },
lastName: { type: String, default: null },
address1: { type: String, default: null },
address2: { type: String, default: null },
city: { type: String, default: null },
profile: { profile: {
alternativeNumber: { type: String, default: null },
firstName: { type: String, default: null },
lastName: { type: String, default: null },
address1: { type: String, default: null },
address2: { type: String, default: null },
city: { type: String, default: null },
state: { type: String, default: null }, state: { type: String, default: null },
country: { type: String, default: null }, country: { type: String, default: null },
}, },

@ -28,6 +28,7 @@ module.exports = function (fastify, opts, next) {
//name: { type: 'string' }, //name: { type: 'string' },
team: { type: 'string', default: null }, team: { type: 'string', default: null },
manager: { type: 'string', default: null }, manager: { type: 'string', default: null },
address: { type: 'string', default: null },
address1: { type: 'string', default: null }, address1: { type: 'string', default: null },
address2: { type: 'string', default: null }, address2: { type: 'string', default: null },
city: { type: 'string', default: null }, city: { type: 'string', default: null },

Loading…
Cancel
Save