Skip to content

Commit 794e8be

Browse files
meesvandongenMees van Dongen
and
Mees van Dongen
authored
chore: replace swapi.co with swapi.org (TanStack#487)
Co-authored-by: Mees van Dongen <mvandongen@ilionx.com>
1 parent 88031d8 commit 794e8be

File tree

4 files changed

+12
-12
lines changed

4 files changed

+12
-12
lines changed

examples/star-wars/src/Character.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import {
88
TableContainer,
99
TableHead,
1010
TableRow,
11-
Paper
11+
Paper,
1212
} from "@material-ui/core";
1313
import { Link as RouterLink } from "react-router-dom";
1414
import { withRouter } from "react-router";
@@ -18,7 +18,7 @@ import fetch from "./fetch";
1818
function Character(props) {
1919
const characterId = props.match.params.characterId;
2020
const { status, error, data } = useQuery(`character-${characterId}`, () =>
21-
fetch(`https://swapi.co/api/people/${characterId}/`)
21+
fetch(`https://swapi.dev/api/people/${characterId}/`)
2222
);
2323

2424
if (status === "loading") return <p>Loading...</p>;
@@ -74,7 +74,7 @@ function Character(props) {
7474
</TableContainer>
7575
<br />
7676
<Typography variant="h4">Films</Typography>
77-
{data.films.map(film => {
77+
{data.films.map((film) => {
7878
const filmUrlParts = film.split("/").filter(Boolean);
7979
const filmId = filmUrlParts[filmUrlParts.length - 1];
8080
return <Film id={filmId} key={`Film-${filmId}`} />;
@@ -86,7 +86,7 @@ function Character(props) {
8686
function Film(props) {
8787
const { id } = props;
8888
const { data, status, error } = useQuery(`film-${id}`, () =>
89-
fetch(`https://swapi.co/api/films/${id}/`)
89+
fetch(`https://swapi.dev/api/films/${id}/`)
9090
);
9191

9292
if (status !== "success") {
@@ -106,7 +106,7 @@ function Film(props) {
106106
function Homeworld(props) {
107107
const { id } = props;
108108
const { data, status } = useQuery(`homeworld-${id}`, () =>
109-
fetch(`https://swapi.co/api/planets/${id}/`)
109+
fetch(`https://swapi.dev/api/planets/${id}/`)
110110
);
111111

112112
if (status !== "success") {

examples/star-wars/src/Characters.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import fetch from "./fetch";
66

77
export default function Characters(props) {
88
const { status, error, data } = useQuery("characters", () =>
9-
fetch(`https://swapi.co/api/people/`)
9+
fetch(`https://swapi.dev/api/people/`)
1010
);
1111

1212
if (status === "loading") return <p>Loading...</p>;
@@ -15,7 +15,7 @@ export default function Characters(props) {
1515
return (
1616
<div>
1717
<Typography variant="h2">Characters</Typography>
18-
{data.results.map(person => {
18+
{data.results.map((person) => {
1919
const personUrlParts = person.url.split("/").filter(Boolean);
2020
const personId = personUrlParts[personUrlParts.length - 1];
2121
return (

examples/star-wars/src/Film.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import fetch from "./fetch";
88
function Film(props) {
99
const filmId = props.match.params.filmId;
1010
const { data, status, error } = useQuery(`film-${filmId}`, () =>
11-
fetch(`https://swapi.co/api/films/${filmId}/`)
11+
fetch(`https://swapi.dev/api/films/${filmId}/`)
1212
);
1313

1414
if (status === "loading") return <p>Loading...</p>;
@@ -24,7 +24,7 @@ function Film(props) {
2424
<Typography variant="body1">{data.opening_crawl}</Typography>
2525
<br />
2626
<Typography variant="h4">Characters</Typography>
27-
{data.characters.map(character => {
27+
{data.characters.map((character) => {
2828
const characterUrlParts = character.split("/").filter(Boolean);
2929
const characterId = characterUrlParts[characterUrlParts.length - 1];
3030
return <Character id={characterId} key={characterId} />;
@@ -36,7 +36,7 @@ function Film(props) {
3636
function Character(props) {
3737
const { id } = props;
3838
const { data, status, error } = useQuery(`character-${id}`, () =>
39-
fetch(`https://swapi.co/api/people/${props.id}/`)
39+
fetch(`https://swapi.dev/api/people/${props.id}/`)
4040
);
4141

4242
if (status !== "success") {

examples/star-wars/src/Films.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import fetch from "./fetch";
66

77
export default function Films(props) {
88
const { data, status, error } = useQuery("films", () =>
9-
fetch("https://swapi.co/api/films/")
9+
fetch("https://swapi.dev/api/films/")
1010
);
1111

1212
if (status === "loading") {
@@ -19,7 +19,7 @@ export default function Films(props) {
1919
return (
2020
<div>
2121
<Typography variant="h2">Films</Typography>
22-
{data.results.map(film => {
22+
{data.results.map((film) => {
2323
const filmUrlParts = film.url.split("/").filter(Boolean);
2424
const filmId = filmUrlParts[filmUrlParts.length - 1];
2525
return (

0 commit comments

Comments
 (0)