We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 45d24e6 commit b0031e8Copy full SHA for b0031e8
src/hooks/useDebouncedFetchSections.ts
@@ -93,7 +93,10 @@ const useDebouncedFetchSection = (
93
94
useEffect(() => {
95
(async () => {
96
- if (debouncedSearchTerm.trim()) {
+ const trimmedTerm = debouncedSearchTerm.trim();
97
+
98
+ // Do not send a request if the encoded term is longer than 199 characters
99
+ if (trimmedTerm && encodeURIComponent(trimmedTerm).length < 200) {
100
try {
101
const response = await cioClient?.autocomplete.getAutocompleteResults(
102
debouncedSearchTerm,
0 commit comments