@@ -233,24 +233,26 @@ const DandiPage: FunctionComponent<DandiPageProps> = ({ width, height }) => {
233
233
setSearchResults ( [ ] ) ;
234
234
setTotalResults ( 0 ) ;
235
235
const dandisets = await Promise . all (
236
- searchResultDandisetIds . slice ( 0 , searchState . currentLimit ) . map ( async ( dandisetId ) => {
237
- const url = `https://api.dandiarchive.org/api/dandisets/${ dandisetId } ` ;
238
- const authorizationHeader = getAuthorizationHeaderForUrl ( url ) ;
239
- const headers = authorizationHeader
240
- ? { Authorization : authorizationHeader }
241
- : undefined ;
236
+ searchResultDandisetIds
237
+ . slice ( 0 , searchState . currentLimit )
238
+ . map ( async ( dandisetId ) => {
239
+ const url = `https://api.dandiarchive.org/api/dandisets/${ dandisetId } ` ;
240
+ const authorizationHeader = getAuthorizationHeaderForUrl ( url ) ;
241
+ const headers = authorizationHeader
242
+ ? { Authorization : authorizationHeader }
243
+ : undefined ;
242
244
243
- try {
244
- const response = await fetch ( url , { headers } ) ;
245
- if ( response . status === 200 ) {
246
- const json = await response . json ( ) ;
247
- return json as DandisetSearchResultItem ;
245
+ try {
246
+ const response = await fetch ( url , { headers } ) ;
247
+ if ( response . status === 200 ) {
248
+ const json = await response . json ( ) ;
249
+ return json as DandisetSearchResultItem ;
250
+ }
251
+ } catch ( error ) {
252
+ console . error ( "Error fetching dandiset details:" , error ) ;
248
253
}
249
- } catch ( error ) {
250
- console . error ( "Error fetching dandiset details:" , error ) ;
251
- }
252
- return null ;
253
- } ) ,
254
+ return null ;
255
+ } ) ,
254
256
) ;
255
257
256
258
// Filter out any failed requests and set results
@@ -260,7 +262,7 @@ const DandiPage: FunctionComponent<DandiPageProps> = ({ width, height }) => {
260
262
setSearchResults ( dandisetsFilt ) ;
261
263
setTotalResults ( searchResultDandisetIds . length ) ;
262
264
} ,
263
- [ searchState . currentLimit ]
265
+ [ searchState . currentLimit ] ,
264
266
) ;
265
267
266
268
return (
0 commit comments