Skip to content

Commit 19e8fb6

Browse files
committed
Patch fetchUrl instead
1 parent 0ce7e21 commit 19e8fb6

2 files changed

Lines changed: 6 additions & 2 deletions

File tree

frontend/app/src/entities/navigation/ui/search-anywhere/search-docs.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ export const SearchDocs = () => {
2626
);
2727
}
2828

29-
if (error || !Array.isArray(results) || results.length === 0) return null;
29+
if (error || results.length === 0) return null;
3030

3131
return (
3232
<SearchAnywhereGroup heading="Documentation">

frontend/app/src/shared/api/rest/fetch.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,11 @@ export const fetchUrl = async (url: string, payload?: RequestInit) => {
2222

2323
const rawResponse = await fetch(url, newPayload);
2424

25-
return rawResponse?.json();
25+
if (!rawResponse.ok) {
26+
throw new Error(`Request failed with status ${rawResponse.status}`);
27+
}
28+
29+
return rawResponse.json();
2630
};
2731

2832
const QSP_TO_INCLUDE = [QSP.BRANCH, QSP.DATETIME];

0 commit comments

Comments
 (0)