|
|
|
@@ -51,18 +51,10 @@ export class MallsPage implements OnInit { |
|
|
|
|
|
|
|
getMallsByFoodType(type: string) { |
|
|
|
this.selectedFoodType = type; |
|
|
|
this.mallService.mallsByTypes(type).then((mallsByTypes: Array<any>) => { |
|
|
|
let malls: any = []; |
|
|
|
if (mallsByTypes.length > 0) { |
|
|
|
mallsByTypes.forEach((mallLocations) => { |
|
|
|
mallLocations.location.forEach((mall) => { |
|
|
|
malls.push(mall); |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
this.allMalls = malls; |
|
|
|
this.tempMalls = malls; |
|
|
|
|
|
|
|
this.mallService.mallsByTypes(type).then((response: Array<any>) => { |
|
|
|
if (response.length > 0) { |
|
|
|
this.allMalls = response; |
|
|
|
this.tempMalls = response; |
|
|
|
} else { |
|
|
|
this.toastService.presentToast("No Malls of the type " + this.selectedFoodType); |
|
|
|
this.allMalls = []; |
|
|
|
@@ -83,6 +75,7 @@ export class MallsPage implements OnInit { |
|
|
|
} |
|
|
|
|
|
|
|
doRefresh(e: any) { |
|
|
|
this.selectedFoodType = ''; |
|
|
|
this.getMallsByLocation(); |
|
|
|
e.target.complete(); |
|
|
|
} |
|
|
|
|