9
9
getUnitNameTranslation ,
10
10
getVehicleTypeRpTranslation ,
11
11
} from '@utils/translations' ;
12
- import { BehaviorSubject , combineLatest , EMPTY , Observable } from 'rxjs' ;
12
+ import { BehaviorSubject , combineLatest , Observable } from 'rxjs' ;
13
13
import { debounceTime , distinctUntilChanged , map , shareReplay , switchMap , tap } from 'rxjs/operators' ;
14
14
15
15
import { APIMostsItem , MostsService } from '../mosts.service' ;
@@ -65,7 +65,7 @@ export class MostsContentsComponent {
65
65
private readonly menu$ = this . brandID$ . pipe (
66
66
distinctUntilChanged ( ) ,
67
67
debounceTime ( 10 ) ,
68
- switchMap ( ( brandID ) => ( brandID ? this . mostsService . getMenu$ ( brandID ) : EMPTY ) ) ,
68
+ switchMap ( ( brandID ) => this . mostsService . getMenu$ ( brandID || 0 ) ) ,
69
69
shareReplay ( 1 ) ,
70
70
) ;
71
71
@@ -91,14 +91,12 @@ export class MostsContentsComponent {
91
91
switchMap ( ( [ ratingCatname , typeCatname , yearsCatname ] ) =>
92
92
this . brandID$ . pipe (
93
93
switchMap ( ( brandID ) =>
94
- brandID
95
- ? this . mostsService . getItems$ ( {
96
- brand_id : brandID ,
97
- rating_catname : ratingCatname ,
98
- type_catname : typeCatname || '' ,
99
- years_catname : yearsCatname || '' ,
100
- } )
101
- : EMPTY ,
94
+ this . mostsService . getItems$ ( {
95
+ brand_id : brandID || 0 ,
96
+ rating_catname : ratingCatname ,
97
+ type_catname : typeCatname || '' ,
98
+ years_catname : yearsCatname || '' ,
99
+ } ) ,
102
100
) ,
103
101
) ,
104
102
) ,
0 commit comments