diff --git a/src/app/contact.service.ts b/src/app/contact.service.ts index 5f658a9..cce1e22 100644 --- a/src/app/contact.service.ts +++ b/src/app/contact.service.ts @@ -394,8 +394,13 @@ getFuelDetail(ustate){ } // http://localhost:3000/trackRoute/routepath/getRoutePathWithPoi?id=5b449ae5755a5527be41f7cc&user=59cbbdbe508f164aa2fef3d8 -getContactsbyDealer(uid){ - return this.http.get(this.dev_url + '/users/getAllUsers?dealer='+uid) +getContactsbyDealer(uid,isProjection =false){ + let apiUrl = this.dev_url + '/users/getAllUsers?dealer='+uid ; + if(isProjection) { + apiUrl = apiUrl + '&projection=user_id,first_name,last_name'; + } + + return this.http.get(apiUrl) .map(res => res.json()); } getDistance(ddid,fromtime,totime,satelite){ @@ -1659,11 +1664,19 @@ getAddressByApi(latlng){ } -getAddressByApiBulk(latlng){ - - return this.http.post(this.dev_url +'/googleAddress/getGoogleAddressBulk',latlng) - .map(res => res.json()); +getAddressByApiBulkOld(latlng){ + let PromiseArray = [], size = 1000; + while (latlng.length > 0) + //PromiseArray.push(this.getAddressInChunk(latlng.splice(0, size))); + Promise.all(PromiseArray).then((values) => { + console.log(values); + }); + +} +getAddressByApiBulk(latlng) { + return this.http.post(this.dev_url +'/googleAddress/getGoogleAddressBulk',latlng) + .map(res => res.json()); } resetPass(pld) { diff --git a/src/app/dashboard/device-edit/device-edit.component.ts b/src/app/dashboard/device-edit/device-edit.component.ts index 6e0f451..d7da1e4 100644 --- a/src/app/dashboard/device-edit/device-edit.component.ts +++ b/src/app/dashboard/device-edit/device-edit.component.ts @@ -725,7 +725,7 @@ showFieldsDealer:boolean=false; passDealer = this.useridd; } console.log(passDealer); - this.contactService.getContactsbyDealer(passDealer) + this.contactService.getContactsbyDealer(passDealer,true) .subscribe(res=>{ console.log("Alluserobject",res); this.costumers = res;