latitude and longitude

master
Bhaskara Kishore 3 years ago
parent 21b384c6ac
commit 94af513b6e

@ -80,6 +80,8 @@ exports.loginSupplier = async (req) => {
office_adress: req.body.office_adress,
zip: req.body.zip,
},
latitude: req.body.latitude,
longitude: req.body.longitude
};
var supplier = new Supplier(s_data);
@ -102,6 +104,8 @@ exports.loginSupplier = async (req) => {
supplier.supplierId = suppliertobeInserted.supplier_id;
supplier.office_adress = suppliertobeInserted.office_adress;
supplier.alternativeContactNumber = suppliertobeInserted.alternativeContactNumber;
supplier.latitude = suppliertobeInserted.latitude;
supplier.longitude = suppliertobeInserted.longitude;
}
@ -137,6 +141,8 @@ exports.loginSupplier = async (req) => {
},
],
profile: insertedSupplier.profile,
latitude: insertedSupplier.latitude,
longitude: insertedSupplier.longitude
},
status_code: 200,
};

@ -192,6 +192,8 @@ exports.loginSupplier = async(request, reply) =>{
office_address: loginObject.supplier.profile.office_address,
phoneVerified: loginObject.supplier.phoneVerified,
oneTimePasswordSetFlag: loginObject.supplier.oneTimePasswordSetFlag,
latitude: loginObject.supplier.latitude,
longitude: loginObject.supplier.longitude,
type: loginObject.supplier.profile.role,
typeasobj: stringToJsonObject,
},
@ -210,6 +212,8 @@ exports.loginSupplier = async(request, reply) =>{
office_address: loginObject.supplier.profile.office_address,
phoneVerified: loginObject.supplier.phoneVerified,
oneTimePasswordSetFlag: loginObject.supplier.oneTimePasswordSetFlag,
latitude: loginObject.supplier.latitude,
longitude: loginObject.supplier.longitude,
type: loginObject.supplier.profile.role,
typeasobj: stringToJsonObject,
},

@ -48,17 +48,22 @@ const supplierSchema = new mongoose.Schema(
default: 'pending'
},
currentGPS: {
// It's important to define type within type field, because
// mongoose use "type" to identify field's object type.
gpsType: { type: String, default: "Point" },
// Default value is needed. Mongoose pass an empty array to
// array type by default, but it will fail MongoDB's pre-save
// validation.
coordinates: { type: [Number], default: [0, 0] },
},
// currentGPS: {
// // It's important to define type within type field, because
// // mongoose use "type" to identify field's object type.
// gpsType: { type: String, default: "Point" },
// // Default value is needed. Mongoose pass an empty array to
// // array type by default, but it will fail MongoDB's pre-save
// // validation.
// coordinates: { type: [Number], default: [0, 0] },
// },
// location: {
// type: { type: String },
// coordinates: [Number]
// },
longitude: { type : Number},
latitude: {type: Number},
isActive: Boolean,
tenantId: ObjectId,
createdAt: {

@ -93,6 +93,8 @@ module.exports = function (fastify, opts, next) {
state: { type: "string", default: null },
zip: { type: "string", default: null },
country: { type: "string", default: null },
latitude: { type: 'number' },
longitude: { type: 'number'}
},
},
security: [

Loading…
Cancel
Save