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(
|
this.apiBackService.addRestaurant(restaurant).subscribe(
|
||||||
resp => {
|
resp => {
|
||||||
this.initForm(EMPTY_RESTAU)
|
this.initForm(EMPTY_RESTAU)
|
||||||
this.successMessage = "Restaurant ajouté !"
|
|
||||||
this.cleanCheckbox()
|
this.cleanCheckbox()
|
||||||
|
this.successMessage = "Restaurant ajouté !"
|
||||||
|
this.router.navigate(['admin'])
|
||||||
|
|
||||||
//this.router.navigate(['restaurants'])
|
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
this.initForm(EMPTY_RESTAU);
|
this.initForm(EMPTY_RESTAU);
|
||||||
@ -181,7 +181,6 @@ export class AddRestauComponent implements OnInit {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
ngOnDestroy() {
|
ngOnDestroy() {
|
||||||
if (this.idRestau) {
|
if (this.idRestau) {
|
||||||
this.idRestau.unsubscribe();
|
this.idRestau.unsubscribe();
|
||||||
|
@ -62,12 +62,12 @@ export class RestoPageComponent implements OnInit {
|
|||||||
restauByCat: this.apiBackService.restoByCat
|
restauByCat: this.apiBackService.restoByCat
|
||||||
}).subscribe(({ restaurants, user, restauByCat }) => {
|
}).subscribe(({ restaurants, user, restauByCat }) => {
|
||||||
|
|
||||||
|
|
||||||
if (this.beforeRoute === "filtres") {
|
if (this.beforeRoute === "filtres") {
|
||||||
this.listRestaurants = this.apiBackService.restoFilter;
|
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.listRestaurants = restauByCat
|
||||||
this.apiBackService.restoByCat = of([]);
|
this.apiBackService.restoByCat = of(restaurants);
|
||||||
} else {
|
} else {
|
||||||
this.listRestaurants = restaurants;
|
this.listRestaurants = restaurants;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user