delete the unused file
This commit is contained in:
parent
8e918dd244
commit
7c5ab7c65f
1 changed files with 0 additions and 14 deletions
|
@ -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;
|
|
||||||
}
|
|
||||||
}
|
|
Loading…
Add table
Reference in a new issue