resolution bug categorie vide
This commit is contained in:
parent
4528d03909
commit
3c2ff28746
@ -131,10 +131,10 @@ export class AddRestauComponent implements OnInit {
|
||||
this.apiBackService.addRestaurant(restaurant).subscribe(
|
||||
resp => {
|
||||
this.initForm(EMPTY_RESTAU)
|
||||
this.successMessage = "Restaurant ajouté !"
|
||||
this.cleanCheckbox()
|
||||
this.successMessage = "Restaurant ajouté !"
|
||||
this.router.navigate(['admin'])
|
||||
|
||||
//this.router.navigate(['restaurants'])
|
||||
}
|
||||
);
|
||||
this.initForm(EMPTY_RESTAU);
|
||||
@ -181,7 +181,6 @@ export class AddRestauComponent implements OnInit {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
ngOnDestroy() {
|
||||
if (this.idRestau) {
|
||||
this.idRestau.unsubscribe();
|
||||
|
@ -62,12 +62,12 @@ export class RestoPageComponent implements OnInit {
|
||||
restauByCat: this.apiBackService.restoByCat
|
||||
}).subscribe(({ restaurants, user, restauByCat }) => {
|
||||
|
||||
|
||||
if (this.beforeRoute === "filtres") {
|
||||
this.listRestaurants = this.apiBackService.restoFilter;
|
||||
} else if (this.beforeRoute === "categories" && restauByCat.length > 0) {
|
||||
this.apiBackService.restoFilter = restaurants;
|
||||
} else if (this.beforeRoute === "categories") {
|
||||
this.listRestaurants = restauByCat
|
||||
this.apiBackService.restoByCat = of([]);
|
||||
this.apiBackService.restoByCat = of(restaurants);
|
||||
} else {
|
||||
this.listRestaurants = restaurants;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user