delete the unused file

This commit is contained in:
Yifei Hu 2024-07-12 12:57:37 +08:00
parent 8e918dd244
commit 7c5ab7c65f

View file

@ -1,14 +0,0 @@
mport fs from "node:fs/promises";
import path from "node:path";
export async function fetchNewsData(id: string) {
try {
const dataDirectory = path.join(process.cwd(), "public", "data");
const filePath = path.join(dataDirectory, `${id}.json`);
const fileContents = await fs.readFile(filePath, "utf8");
return JSON.parse(fileContents);
} catch (error) {
console.error("Error reading news data:", error);
return null;
}
}