Skip to content

Commit

Permalink
chore: explicit JSON.parse call
Browse files Browse the repository at this point in the history
  • Loading branch information
ovflowd committed Nov 9, 2024
1 parent 1a68031 commit d49e34a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 3 additions & 1 deletion apps/site/next-data/changelogData.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@ const getChangelogData = (version: string): Promise<string> => {
// When we're on RSC with Server capabilities we prefer using Next.js Data Fetching
// as this will load cached data from the server instead of generating data on the fly
// this is extremely useful for ISR and SSG as it will not generate this data on every request
return fetch(`${NEXT_DATA_URL}changelog-data/${version}`).then(r => r.json());
return fetch(`${NEXT_DATA_URL}changelog-data/${version}`)
.then(r => r.text())
.then(JSON.parse);
};

export default getChangelogData;
4 changes: 3 additions & 1 deletion apps/site/next-data/releaseData.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@ const getReleaseData = (): Promise<Array<NodeRelease>> => {
// When we're on RSC with Server capabilities we prefer using Next.js Data Fetching
// as this will load cached data from the server instead of generating data on the fly
// this is extremely useful for ISR and SSG as it will not generate this data on every request
return fetch(`${NEXT_DATA_URL}release-data`).then(r => r.json());
return fetch(`${NEXT_DATA_URL}release-data`)
.then(r => r.text())
.then(JSON.parse);
};

export default getReleaseData;

0 comments on commit d49e34a

Please sign in to comment.