Skip to content

Commit 04dab68

Browse files
authored
Update default image asset in the public directory and update api route to only search for files that end with .json (#5179)
* Update default image asset in the public directory * Enhance file filtering in getScripts function to include only JSON files
1 parent b001687 commit 04dab68

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

frontend/public/defaultimg.png

34.1 KB
Loading

frontend/src/app/api/categories/route.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,11 @@ const getMetadata = async () => {
1919

2020
const getScripts = async () => {
2121
const filePaths = (await fs.readdir(jsonDir))
22-
.filter((fileName) => fileName !== metadataFileName && fileName !== versionFileName)
22+
.filter((fileName) =>
23+
fileName.endsWith(".json") &&
24+
fileName !== metadataFileName &&
25+
fileName !== versionFileName
26+
)
2327
.map((fileName) => path.resolve(jsonDir, fileName));
2428

2529
const scripts = await Promise.all(

0 commit comments

Comments
 (0)