File tree Expand file tree Collapse file tree 1 file changed +9
-8
lines changed Expand file tree Collapse file tree 1 file changed +9
-8
lines changed Original file line number Diff line number Diff line change @@ -93,6 +93,7 @@ export class RemoteSelectField extends Component {
93
93
open : true ,
94
94
} ) ) ;
95
95
} catch ( e ) {
96
+ console . error ( e ) ;
96
97
this . setState ( {
97
98
error : true ,
98
99
isFetching : false ,
@@ -105,8 +106,8 @@ export class RemoteSelectField extends Component {
105
106
const { suggestionAPIUrl, suggestionAPIQueryParams, suggestionAPIHeaders } =
106
107
this . props ;
107
108
108
- return axios
109
- . get ( suggestionAPIUrl , {
109
+ try {
110
+ const response = await axios . get ( suggestionAPIUrl , {
110
111
params : {
111
112
suggest : searchQuery ,
112
113
size : DEFAULT_SUGGESTION_SIZE ,
@@ -116,13 +117,13 @@ export class RemoteSelectField extends Component {
116
117
// There is a bug in axios that prevents brackets from being encoded,
117
118
// remove the paramsSerializer when fixed.
118
119
// https://github.com/axios/axios/issues/3316
119
- paramsSerializer : ( params ) => {
120
- return queryString . stringify ( params , { arrayFormat : "repeat" } ) ;
121
- } ,
122
- } )
123
- . then ( ( resp ) => {
124
- return resp ?. data ?. hits ?. hits ;
120
+ paramsSerializer : ( params ) =>
121
+ queryString . stringify ( params , { arrayFormat : "repeat" } ) ,
125
122
} ) ;
123
+ return response ?. data ?. hits ?. hits ;
124
+ } catch ( e ) {
125
+ console . error ( e ) ;
126
+ }
126
127
} ;
127
128
128
129
getNoResultsMessage = ( ) => {
You can’t perform that action at this time.
0 commit comments