bug restauCateg = ok
This commit is contained in:
parent
8b70164a9f
commit
f7d6b0f691
1 changed files with 42 additions and 39 deletions
|
@ -1,5 +1,5 @@
|
|||
import { Component, OnInit } from '@angular/core';
|
||||
import { forkJoin } from 'rxjs';
|
||||
import { forkJoin, of } from 'rxjs';
|
||||
import { ApiBackService } from 'src/app/services/api-back.service';
|
||||
import { TokenService } from 'src/app/services/token.service';
|
||||
import { Preference } from '../models/preference';
|
||||
|
@ -30,6 +30,8 @@ export class RestoPageComponent implements OnInit {
|
|||
|
||||
this.restauLiked();
|
||||
|
||||
this.listRestaurants = [];
|
||||
|
||||
this.userId = this.tokenService.getCurrentUserId();
|
||||
|
||||
}
|
||||
|
@ -63,8 +65,9 @@ export class RestoPageComponent implements OnInit {
|
|||
|
||||
if (this.beforeRoute === "filtres") {
|
||||
this.listRestaurants = this.apiBackService.restoFilter;
|
||||
}else if(this.beforeRoute === "categories" ){
|
||||
} else if (this.beforeRoute === "categories" && restauByCat.length > 0) {
|
||||
this.listRestaurants = restauByCat
|
||||
this.apiBackService.restoByCat = of([]);
|
||||
} else {
|
||||
this.listRestaurants = restaurants;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue