change the npm to yarn and update the json

This commit is contained in:
Yifei Hu 2024-07-10 11:00:11 +08:00
parent 78738c9282
commit effd1d38d0
19 changed files with 4111 additions and 6 deletions

9
ui/lib/fetchNewsData.ts Normal file
View 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();
}