File tree Expand file tree Collapse file tree 1 file changed +9
-7
lines changed Expand file tree Collapse file tree 1 file changed +9
-7
lines changed Original file line number Diff line number Diff line change @@ -70,14 +70,16 @@ export default class SPService implements ISPService {
70
70
71
71
const data = await this . _context . spHttpClient . get ( queryUrl , SPHttpClient . configurations . v1 ) ;
72
72
if ( data . ok ) {
73
- var result : ISPLists = await data . json ( ) ;
74
- var filteredLists = filter ( result . value , ( aList : ISPList ) => {
75
- return find ( aList . ContentTypes , ( ct ) => {
76
- return ct . Id . StringValue . toUpperCase ( ) . startsWith ( options . contentTypeId . toUpperCase ( ) ) ;
77
- } ) ;
73
+ const result : ISPLists = await data . json ( ) ;
74
+ if ( options . contentTypeId ) {
75
+ const filteredLists = filter ( result . value , ( aList : ISPList ) => {
76
+ return find ( aList . ContentTypes , ( ct ) => {
77
+ return ct . Id . StringValue . toUpperCase ( ) . startsWith ( options . contentTypeId . toUpperCase ( ) ) ;
78
+ } ) ;
78
79
79
- } ) ;
80
- result . value = filteredLists as ISPList [ ] ;
80
+ } ) ;
81
+ result . value = filteredLists as ISPList [ ] ;
82
+ }
81
83
return result as ISPLists ;
82
84
} else {
83
85
return null ;
You can’t perform that action at this time.
0 commit comments