I'm using the searchbox and i'm getting below error for the code below. what am i missing?
Unhandled Rejection (TypeError): Cannot read properties of undefined (reading 'request_id')
(anonymous function)
C:/workspaces/ortho/ORTHO_CLINICAL_GlobalB2BPortal_AZURE_REPO/src/AppSearchAPIConnector.js:171
168 | this.beforeAutocompleteSuggestionsCall(options, newOptions =>
169 | this.client.querySuggestion(searchTerm, newOptions).then(response => {
170 | autocompletedState.autocompletedSuggestions = response.results;>
171 | autocompletedState.autocompletedSuggestionsRequestId =
| ^
172 | response.meta.request_id;
173 | })
174 | )
<SearchBox
autocompleteResults={{titleField: "title",urlField: "nps_link"}}
shouldClearFilters={false}
autocompleteSuggestions={true}
debounceLength={4}
autocompleteMinimumCharacters={4}
onSubmit={searchTerm => setSearchTerm(searchTerm)}
onSelectAutocomplete={(selection, { }, defaultOnSelectAutocomplete) => {
if (selection.suggestion) {
setSearchTerm(selection.suggestion);
} else {
defaultOnSelectAutocomplete(selection);
}
}}
/>