File tree Expand file tree Collapse file tree 4 files changed +16
-24
lines changed Expand file tree Collapse file tree 4 files changed +16
-24
lines changed Original file line number Diff line number Diff line change @@ -16,7 +16,7 @@ export function PaginationFilterContainPipe(
1616 { data : field } : ArgumentMetadata
1717 ) : Promise < Record < string , { $regex : RegExp ; $options : string } > > {
1818 if ( ! value ) {
19- return undefined ;
19+ value = '' ;
2020 }
2121
2222 if (
Original file line number Diff line number Diff line change @@ -19,10 +19,6 @@ export function PaginationFilterDatePipe(
1919 value : string ,
2020 { data : field } : ArgumentMetadata
2121 ) : Promise < Record < string , Date > > {
22- if ( ! value ) {
23- return undefined ;
24- }
25-
2622 let date : Date = this . helperDateService . create ( value ) ;
2723
2824 if (
Original file line number Diff line number Diff line change @@ -17,17 +17,15 @@ export function PaginationFilterInBooleanPipe(
1717 value : string ,
1818 { data : field } : ArgumentMetadata
1919 ) : Promise < Record < string , { $in : boolean [ ] } > > {
20- if ( ! value ) {
21- return undefined ;
22- }
20+ let finalValue : boolean [ ] = defaultValue as boolean [ ] ;
2321
24- const val : boolean [ ] = value
25- ? this . helperArrayService . unique (
26- value . split ( ',' ) . map ( ( val : string ) => val === 'true' )
27- )
28- : defaultValue ;
22+ if ( value ) {
23+ finalValue = this . helperArrayService . unique (
24+ value . split ( ',' ) . map ( ( val : string ) => val === 'true' )
25+ ) ;
26+ }
2927
30- return this . paginationService . filterIn < boolean > ( field , val ) ;
28+ return this . paginationService . filterIn < boolean > ( field , finalValue ) ;
3129 }
3230 }
3331
Original file line number Diff line number Diff line change @@ -14,18 +14,16 @@ export function PaginationFilterInEnumPipe<T>(
1414 value : string ,
1515 { data : field } : ArgumentMetadata
1616 ) : Promise < Record < string , { $in : T [ ] } > > {
17- if ( ! value ) {
18- return undefined ;
19- }
17+ let finalValue : T [ ] = defaultValue as T [ ] ;
2018
21- const val : T [ ] = value
22- ? ( value
23- . split ( ',' )
24- . map ( ( val : string ) => defaultEnum [ val ] )
25- . filter ( ( val : string ) => val ) as T [ ] )
26- : ( defaultValue as T [ ] ) ;
19+ if ( value ) {
20+ finalValue = value
21+ . split ( ',' )
22+ . map ( ( val : string ) => defaultEnum [ val ] )
23+ . filter ( ( val : string ) => val ) as T [ ] ;
24+ }
2725
28- return this . paginationService . filterIn < T > ( field , val ) ;
26+ return this . paginationService . filterIn < T > ( field , finalValue ) ;
2927 }
3028 }
3129
You can’t perform that action at this time.
0 commit comments