change the npm to yarn and update the json
This commit is contained in:
parent
78738c9282
commit
effd1d38d0
19 changed files with 4111 additions and 6 deletions
9
ui/lib/fetchNewsData.ts
Normal file
9
ui/lib/fetchNewsData.ts
Normal file
|
@ -0,0 +1,9 @@
|
|||
export async function fetchNewsData(id: string) {
|
||||
const response = await fetch(
|
||||
`https://raw.githubusercontent.com/newspedia-crew/newspedia-web/intern-change/public/data/${id}.json`,
|
||||
);
|
||||
if (!response.ok) {
|
||||
return null;
|
||||
}
|
||||
return response.json();
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue