location radius search
This commit is contained in:
@@ -96,8 +96,8 @@ for (let index = 0; index < usersData.length; index++) {
|
||||
user.companyLocation = userData.companyLocation;
|
||||
const [city, state] = user.companyLocation.split('-').map(e => e.trim());
|
||||
const cityGeo = geos.states.find(s => s.state_code === state).cities.find(c => c.name === city);
|
||||
const latitude = cityGeo.latitude;
|
||||
const longitude = cityGeo.longitude;
|
||||
user.latitude = cityGeo.latitude;
|
||||
user.longitude = cityGeo.longitude;
|
||||
user.offeredServices = userData.offeredServices;
|
||||
user.gender = userData.gender;
|
||||
user.customerType = 'professional';
|
||||
@@ -151,8 +151,8 @@ for (let index = 0; index < commercialJsonData.length; index++) {
|
||||
commercial.type = sso.typesOfCommercialProperty.find(e => e.oldValue === String(commercial.type)).value;
|
||||
const cityGeo = geos.states.find(s => s.state_code === commercial.state).cities.find(c => c.name === commercial.city);
|
||||
try {
|
||||
const latitude = cityGeo.latitude;
|
||||
const longitude = cityGeo.longitude;
|
||||
commercial.latitude = cityGeo.latitude;
|
||||
commercial.longitude = cityGeo.longitude;
|
||||
} catch (e) {
|
||||
console.log(`----------------> ERROR ${commercial.state} - ${commercial.city}`);
|
||||
}
|
||||
@@ -191,8 +191,8 @@ for (let index = 0; index < businessJsonData.length; index++) {
|
||||
business.imageName = emailToDirName(user.email);
|
||||
const cityGeo = geos.states.find(s => s.state_code === business.state).cities.find(c => c.name === business.city);
|
||||
try {
|
||||
const latitude = cityGeo.latitude;
|
||||
const longitude = cityGeo.longitude;
|
||||
business.latitude = cityGeo.latitude;
|
||||
business.longitude = cityGeo.longitude;
|
||||
} catch (e) {
|
||||
console.log(`----------------> ERROR ${business.state} - ${business.city}`);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user