| @@ -26,6 +26,7 @@ export class MallsPage implements OnInit { | |||||
| ngOnInit() { | ngOnInit() { | ||||
| this.getMallsByLocation(); | this.getMallsByLocation(); | ||||
| this.getMallsByFoodType('pizza'); | |||||
| } | } | ||||
| toggleMallBookmark(index: number) { | toggleMallBookmark(index: number) { | ||||
| @@ -74,6 +75,12 @@ export class MallsPage implements OnInit { | |||||
| } | } | ||||
| } | } | ||||
| getMallsByFoodType(type: string) { | |||||
| this.mallService.mallsByTypes(type).then((data) => { | |||||
| console.log(data); | |||||
| }); | |||||
| } | |||||
| getMallsByLocation() { | getMallsByLocation() { | ||||
| if (navigator.geolocation) { | if (navigator.geolocation) { | ||||
| this.toastService.presentToast("Getting malls based on your location...", "dark"); | this.toastService.presentToast("Getting malls based on your location...", "dark"); | ||||
| @@ -22,6 +22,19 @@ export class MallService { | |||||
| }; | }; | ||||
| return await this.http.get(URL + '/api/maioraservice/mall/v1/latitude/' + latitude + '/longitude/' + longitude + '/check/', httpOptions).toPromise(); | return await this.http.get(URL + '/api/maioraservice/mall/v1/latitude/' + latitude + '/longitude/' + longitude + '/check/', httpOptions).toPromise(); | ||||
| } | |||||
| async mallsByTypes(type: string) { | |||||
| const httpOptions = { | |||||
| headers: new HttpHeaders({ | |||||
| 'Access-Control-Allow-Origin': '*', | |||||
| 'Content-Type': 'application/json', | |||||
| 'Authorization': 'Bearer ' + localStorage.access_Token | |||||
| }) | |||||
| }; | |||||
| return await this.http.get(URL + '/api/maioraservice/mall/v1/outlet_type/' + type + '/', httpOptions).toPromise(); | |||||
| } | } | ||||
| async allMalls() { | async allMalls() { | ||||