Skip to content

Commit 0103880

Browse files
committed
fix example swapi endpoint
1 parent 0bea4d3 commit 0103880

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

example/index.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ const fetchStarwarsHero = async (
3838
id: string,
3939
abortSignal?: AbortSignal
4040
): Promise<StarwarsHero> => {
41-
const result = await fetch(`https://swapi.co/api/people/${id}/`, {
41+
const result = await fetch(`https://swapi.dev/api/people/${id}/`, {
4242
signal: abortSignal,
4343
});
4444
if (result.status !== 200) {
@@ -52,7 +52,7 @@ const searchStarwarsHero = async (
5252
abortSignal?: AbortSignal
5353
): Promise<StarwarsHero[]> => {
5454
const result = await fetch(
55-
`https://swapi.co/api/people/?search=${encodeURIComponent(text)}`,
55+
`https://swapi.dev/api/people/?search=${encodeURIComponent(text)}`,
5656
{
5757
signal: abortSignal,
5858
}

0 commit comments

Comments
 (0)