File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed
packages/docs/src/routes/examples/apps/reactivity/auto-complete Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -7,7 +7,7 @@ export default component$(() => {
7
7
< br />
8
8
< br />
9
9
Go ahead, search for Star Wars characters such as "Luke Skywalker", it uses the{ ' ' }
10
- < a href = "https://swapi-node.vercel.app /" > Star Wars API</ a > :
10
+ < a href = "https://swapi.py4e.com /" > Star Wars API</ a > :
11
11
< br />
12
12
< br />
13
13
< AutoComplete > </ AutoComplete >
@@ -68,16 +68,16 @@ export const SuggestionsListComponent = (props: { state: IState }) => {
68
68
} ;
69
69
70
70
const getPeople = ( searchInput : string , controller ?: AbortController ) : Promise < string [ ] > =>
71
- fetch ( `https://swapi-node.vercel.app /api/people/?search=${ searchInput } ` , {
71
+ fetch ( `https://swapi.py4e.com /api/people/?search=${ searchInput } ` , {
72
72
signal : controller ?. signal ,
73
73
} )
74
74
. then ( ( response ) => {
75
75
return response . json ( ) ;
76
76
} )
77
77
. then ( ( parsedResponse ) => {
78
- debugger ;
79
- return parsedResponse . results . map ( ( people : any ) => people . fields . name ) ;
80
- } ) ;
78
+ return parsedResponse . results . map ( ( people : { name : string } ) => people . name ) ;
79
+ } )
80
+ . catch ( ( e ) => console . error ( 'fetch failed' , e ) ) ;
81
81
82
82
function debounce < F extends ( ...args : any ) => any > ( fn : F , delay = 500 ) {
83
83
let timeoutId : ReturnType < typeof setTimeout > ;
You can’t perform that action at this time.
0 commit comments