Skip to content

Commit d1d59e9

Browse files
committed
Updated SWAPI
1 parent d08b400 commit d1d59e9

4 files changed

+6
-6
lines changed

src/02-passing-type-arguments/11-data-fetcher.problem.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ const fetchData = async (url: string) => {
88

99
it("Should fetch data from an API", async () => {
1010
const data = await fetchData<{ name: string }>(
11-
"https://swapi.dev/api/people/1",
11+
"https://swapi.py4e.com/api/people/1",
1212
);
1313
expect(data.name).toEqual("Luke Skywalker");
1414

src/02-passing-type-arguments/11-data-fetcher.solution.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ const fetchData = async <TData>(url: string) => {
99

1010
it("Should fetch data from an API", async () => {
1111
const data = await fetchData<{ name: string }>(
12-
"https://swapi.dev/api/people/1"
12+
"https://swapi.py4e.com/api/people/1"
1313
);
1414
expect(data.name).toEqual("Luke Skywalker");
1515

src/06-challenges/32-data-fetcher-with-warning.problem.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,15 @@ const fetchData = async <TResult>(url: string): Promise<TResult> => {
88

99
it("Should fetch data from an API", async () => {
1010
const data = await fetchData<{ name: string }>(
11-
"https://swapi.dev/api/people/1",
11+
"https://swapi.py4e.com/api/people/1",
1212
);
1313
expect(data.name).toEqual("Luke Skywalker");
1414

1515
type tests = [Expect<Equal<typeof data, { name: string }>>];
1616
});
1717

1818
it("Should force you to add a type annotation with a helpful error message", async () => {
19-
const data = await fetchData("https://swapi.dev/api/people/1");
19+
const data = await fetchData("https://swapi.py4e.com/api/people/1");
2020

2121
type tests = [
2222
Expect<Equal<typeof data, "You must pass a type argument to fetchData">>,

src/06-challenges/32-data-fetcher-with-warning.solution.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,15 @@ const fetchData = async <
1212

1313
it("Should fetch data from an API", async () => {
1414
const data = await fetchData<{ name: string }>(
15-
"https://swapi.dev/api/people/1"
15+
"https://swapi.py4e.com/api/people/1"
1616
);
1717
expect(data.name).toEqual("Luke Skywalker");
1818

1919
type tests = [Expect<Equal<typeof data, { name: string }>>];
2020
});
2121

2222
it("Should force you to add a type annotation", async () => {
23-
const data = await fetchData("https://swapi.dev/api/people/1");
23+
const data = await fetchData("https://swapi.py4e.com/api/people/1");
2424

2525
type tests = [
2626
Expect<Equal<typeof data, "You must pass a type argument to fetchData">>

0 commit comments

Comments
 (0)