Skip to content

Commit 58c21df

Browse files
committed
chore: update stablecoinsData.ts
1 parent 47a2ac3 commit 58c21df

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/lib/api/stablecoinsData.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ export async function fetchEthereumEcosystemData() {
44
const url = `${COINGECKO_API_BASE_URL}ethereum-ecosystem${COINGECKO_API_URL_PARAMS}`
55

66
try {
7-
const ethereumEcosystemData = await fetch(url).then((res) => res.json())
7+
const res = await fetch(url)
88

9-
return ethereumEcosystemData
9+
return res.json()
1010
} catch (error) {
1111
// In production mode, throw an error to stop the build in case this fetch fails
1212
console.error(error)
@@ -20,14 +20,14 @@ export async function fetchEthereumStablecoinsData() {
2020
const url = `${COINGECKO_API_BASE_URL}stablecoins${COINGECKO_API_URL_PARAMS}`
2121

2222
try {
23-
const ethereumStablecoinsData = await fetch(url).then((res) => res.json())
23+
const res = await fetch(url)
2424

25-
return ethereumStablecoinsData
25+
return res.json()
2626
} catch (error) {
2727
// In production mode, throw an error to stop the build in case this fetch fails
2828
console.error(error)
2929
throw new Error(
30-
"Something went wrong with requesting the Ethereum ecosystem data."
30+
"Something went wrong with requesting the Ethereum stablecoins data."
3131
)
3232
}
3333
}

0 commit comments

Comments
 (0)