Skip to content

Commit 05e7255

Browse files
committed
formatting
1 parent d7f2b8a commit 05e7255

File tree

1 file changed

+19
-17
lines changed

1 file changed

+19
-17
lines changed

src/pages/DandiPage/DandiPage.tsx

Lines changed: 19 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -233,24 +233,26 @@ const DandiPage: FunctionComponent<DandiPageProps> = ({ width, height }) => {
233233
setSearchResults([]);
234234
setTotalResults(0);
235235
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;
242244

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);
248253
}
249-
} catch (error) {
250-
console.error("Error fetching dandiset details:", error);
251-
}
252-
return null;
253-
}),
254+
return null;
255+
}),
254256
);
255257

256258
// Filter out any failed requests and set results
@@ -260,7 +262,7 @@ const DandiPage: FunctionComponent<DandiPageProps> = ({ width, height }) => {
260262
setSearchResults(dandisetsFilt);
261263
setTotalResults(searchResultDandisetIds.length);
262264
},
263-
[searchState.currentLimit]
265+
[searchState.currentLimit],
264266
);
265267

266268
return (

0 commit comments

Comments
 (0)