mirror of
https://github.com/valitydev/dashboard.git
synced 2024-11-06 10:35:21 +00:00
🦊 small fit to fetcher 🦊 (#87)
This commit is contained in:
parent
7f8bad30c3
commit
8a348da8ed
@ -2,3 +2,4 @@ export * from './map-to-shop-info';
|
||||
export * from './filter-shops-by-env';
|
||||
export * from './map-to-timestamp';
|
||||
export * from './negate-env';
|
||||
export * from './remove-empty-properties';
|
||||
|
@ -0,0 +1,4 @@
|
||||
import isNil from 'lodash.isnil';
|
||||
|
||||
export const removeEmptyProperties = <T>(obj: T): T =>
|
||||
Object.keys(obj).reduce((acc, cur) => (!isNil(obj[cur]) ? { ...acc, [cur]: obj[cur] } : acc), {} as T);
|
@ -12,7 +12,7 @@ import { toFormValue } from './to-form-value';
|
||||
import { SearchFormValue } from '../../search-form-value';
|
||||
import { ShopService } from '../../../../../api';
|
||||
import { takeRouteParam } from '../../../../../custom-operators';
|
||||
import { mapToShopInfo, ShopInfo, filterShopsByEnv } from '../../operators';
|
||||
import { mapToShopInfo, ShopInfo, filterShopsByEnv, removeEmptyProperties } from '../../operators';
|
||||
|
||||
@Injectable()
|
||||
export class SearchFormService {
|
||||
@ -47,6 +47,7 @@ export class SearchFormService {
|
||||
formValueChanges(valueDebounceTime: number): Observable<PaymentSearchFormValue> {
|
||||
return this.searchForm.valueChanges.pipe(
|
||||
filter(() => this.searchForm.status === 'VALID'),
|
||||
removeEmptyProperties,
|
||||
debounceTime(valueDebounceTime)
|
||||
);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user