@@ -18,7 +18,8 @@ import {isReportListItemType, isTransactionListItemType} from '@libs/SearchUIUti
1818import playSound , { SOUNDS } from '@libs/Sound' ;
1919import CONST from '@src/CONST' ;
2020import ONYXKEYS from '@src/ONYXKEYS' ;
21- import FILTER_KEYS from '@src/types/form/SearchAdvancedFiltersForm' ;
21+ import { FILTER_KEYS } from '@src/types/form/SearchAdvancedFiltersForm' ;
22+ import type { SearchAdvancedFiltersForm } from '@src/types/form/SearchAdvancedFiltersForm' ;
2223import type { LastPaymentMethod , LastPaymentMethodType , SearchResults } from '@src/types/onyx' ;
2324import type { SearchPolicy , SearchReport , SearchTransaction } from '@src/types/onyx/SearchResults' ;
2425import type Nullable from '@src/types/utils/Nullable' ;
@@ -421,10 +422,20 @@ function clearAllFilters() {
421422}
422423
423424function clearAdvancedFilters ( ) {
424- const values : Partial < Record < ValueOf < typeof FILTER_KEYS > , null > > = { } ;
425+ const values : Partial < Nullable < SearchAdvancedFiltersForm > > = { } ;
425426 Object . values ( FILTER_KEYS )
426- . filter ( ( key ) => ! ( [ FILTER_KEYS . TYPE , FILTER_KEYS . STATUS , FILTER_KEYS . GROUP_BY ] as string [ ] ) . includes ( key ) )
427+ . filter ( ( key ) => key !== FILTER_KEYS . GROUP_BY )
427428 . forEach ( ( key ) => {
429+ if ( key === FILTER_KEYS . TYPE ) {
430+ values [ key ] = CONST . SEARCH . DATA_TYPES . EXPENSE ;
431+ return ;
432+ }
433+
434+ if ( key === FILTER_KEYS . STATUS ) {
435+ values [ key ] = CONST . SEARCH . STATUS . EXPENSE . ALL ;
436+ return ;
437+ }
438+
428439 values [ key ] = null ;
429440 } ) ;
430441
0 commit comments