Skip to content

Commit bb48816

Browse files
committed
서비스가 중지된 API의 URL 교체
1 parent da51a0e commit bb48816

File tree

1 file changed

+3
-8
lines changed
  • ch9_SNSApp/src/Context/RandomUserData

1 file changed

+3
-8
lines changed

ch9_SNSApp/src/Context/RandomUserData/index.tsx

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -71,17 +71,12 @@ const RandomUserDataProvider = ({cache, children}: Props) => {
7171

7272
try {
7373
const response = await fetch(
74-
'https://opinionated-quotes-api.gigalixirapp.com/v1/quotes?rand=t&n=25',
74+
'https://raw.githubusercontent.com/dev-yakuza/users/master/lorem.json',
7575
);
7676
const data = await response.json();
7777

78-
let text = [];
79-
for (const index in data.quotes) {
80-
text.push(data.quotes[index].quote);
81-
}
82-
83-
setDescriptionList(text);
84-
setCachedData('DescriptionList', text);
78+
setDescriptionList(data);
79+
setCachedData('DescriptionList', data);
8580
} catch (error) {
8681
console.log(error);
8782
}

0 commit comments

Comments
 (0)